#[non_exhaustive]pub enum AozoraNode<'src> {
Show 17 variants
Ruby(&'src Ruby<'src>),
Bouten(&'src Bouten<'src>),
TateChuYoko(&'src TateChuYoko<'src>),
Gaiji(&'src Gaiji<'src>),
Indent(Indent),
AlignEnd(AlignEnd),
Warichu(&'src Warichu<'src>),
Keigakomi(Keigakomi),
PageBreak,
SectionBreak(SectionKind),
AozoraHeading(&'src AozoraHeading<'src>),
HeadingHint(&'src HeadingHint<'src>),
Sashie(&'src Sashie<'src>),
Kaeriten(&'src Kaeriten<'src>),
Annotation(&'src Annotation<'src>),
DoubleRuby(&'src DoubleRuby<'src>),
Container(Container),
}Expand description
Every Aozora-specific AST node, in borrowed form.
'src is the lifetime of the arena (and of source-text slices the
arena does not own). Mirrors the variant set of the legacy owned
[aozora_syntax owned API (no longer present)] type 1:1.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Ruby(&'src Ruby<'src>)
Ruby (furigana). See Ruby.
Bouten(&'src Bouten<'src>)
Emphasis dots / sidelines. See Bouten.
TateChuYoko(&'src TateChuYoko<'src>)
Tate-chu-yoko (horizontal embedding inside vertical text).
Gaiji(&'src Gaiji<'src>)
Out-of-character-range glyph reference. See Gaiji.
Indent(Indent)
Indentation marker. Carries no string content; uses the legacy
owned Indent type unchanged.
AlignEnd(AlignEnd)
End-aligned text marker.
Warichu(&'src Warichu<'src>)
Warichu (split annotation). See Warichu.
Keigakomi(Keigakomi)
Keigakomi (boxed text marker, no fields).
PageBreak
Page break ([#改ページ]).
SectionBreak(SectionKind)
Section break — [#改丁/改段/改見開き].
AozoraHeading(&'src AozoraHeading<'src>)
Aozora heading (窓見出し / 副見出し). See AozoraHeading.
HeadingHint(&'src HeadingHint<'src>)
Forward-reference heading hint ([#「X」は大見出し]).
Sashie(&'src Sashie<'src>)
Illustration ([#挿絵]).
Kaeriten(&'src Kaeriten<'src>)
Chinese-reading-order mark (返り点).
Annotation(&'src Annotation<'src>)
Generic annotation when no more specific recogniser matched.
DoubleRuby(&'src DoubleRuby<'src>)
《《…》》 double-bracket bouten. See DoubleRuby.
Container(Container)
Paired-container open ([#ここから字下げ] etc.).
Implementations§
Source§impl AozoraNode<'_>
AozoraNode classifier methods. Mirror the inherent methods on
the legacy owned [aozora_syntax owned API (no longer present)] 1:1 so a renderer compiled
against either AST takes the same code path and the same XML
snapshot string.
impl AozoraNode<'_>
AozoraNode classifier methods. Mirror the inherent methods on
the legacy owned [aozora_syntax owned API (no longer present)] 1:1 so a renderer compiled
against either AST takes the same code path and the same XML
snapshot string.
Sourcepub const fn is_block(&self) -> bool
pub const fn is_block(&self) -> bool
True iff this node occupies a paragraph position in the document tree (and therefore shouldn’t be wrapped inside a surrounding text run by the renderer).
Sourcepub const fn contains_inlines(&self) -> bool
pub const fn contains_inlines(&self) -> bool
Whether children of this node (if any) are inline content.
Block variants that wrap an indented run of paragraphs answer
true; leaf blocks answer false. Container is the
paired-container wrapper — its children are block elements,
so it answers false here.
Sourcepub const fn xml_node_name(&self) -> &'static str
pub const fn xml_node_name(&self) -> &'static str
Stable XML/element-style node name used by HTML / serialiser /
snapshot tests. Identical to the legacy
[aozora_syntax owned API (no longer present)::xml_node_name] return values to keep
snapshot tests cross-compatible.
Sourcepub const fn kind(&self) -> NodeKind
pub const fn kind(&self) -> NodeKind
Cross-cutting crate::NodeKind tag for this node.
Driver wire formats (aozora-ffi / aozora-wasm / aozora-py)
project to the camelCase string via
NodeKind::as_camel_case;
internal consumers can match on the typed enum directly.
Trait Implementations§
Source§impl<'src> Clone for AozoraNode<'src>
impl<'src> Clone for AozoraNode<'src>
Source§fn clone(&self) -> AozoraNode<'src>
fn clone(&self) -> AozoraNode<'src>
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl<'src> Debug for AozoraNode<'src>
impl<'src> Debug for AozoraNode<'src>
Source§impl<'src> PartialEq for AozoraNode<'src>
impl<'src> PartialEq for AozoraNode<'src>
impl<'src> Copy for AozoraNode<'src>
impl<'src> Eq for AozoraNode<'src>
impl<'src> StructuralPartialEq for AozoraNode<'src>
Auto Trait Implementations§
impl<'src> Freeze for AozoraNode<'src>
impl<'src> RefUnwindSafe for AozoraNode<'src>
impl<'src> Send for AozoraNode<'src>
impl<'src> Sync for AozoraNode<'src>
impl<'src> Unpin for AozoraNode<'src>
impl<'src> UnsafeUnpin for AozoraNode<'src>
impl<'src> UnwindSafe for AozoraNode<'src>
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<D> OwoColorize for D
impl<D> OwoColorize for D
§fn fg<C>(&self) -> FgColorDisplay<'_, C, Self>where
C: Color,
fn fg<C>(&self) -> FgColorDisplay<'_, C, Self>where
C: Color,
§fn bg<C>(&self) -> BgColorDisplay<'_, C, Self>where
C: Color,
fn bg<C>(&self) -> BgColorDisplay<'_, C, Self>where
C: Color,
§fn on_magenta(&self) -> BgColorDisplay<'_, Magenta, Self>
fn on_magenta(&self) -> BgColorDisplay<'_, Magenta, Self>
§fn default_color(&self) -> FgColorDisplay<'_, Default, Self>
fn default_color(&self) -> FgColorDisplay<'_, Default, Self>
§fn on_default_color(&self) -> BgColorDisplay<'_, Default, Self>
fn on_default_color(&self) -> BgColorDisplay<'_, Default, Self>
§fn bright_black(&self) -> FgColorDisplay<'_, BrightBlack, Self>
fn bright_black(&self) -> FgColorDisplay<'_, BrightBlack, Self>
§fn on_bright_black(&self) -> BgColorDisplay<'_, BrightBlack, Self>
fn on_bright_black(&self) -> BgColorDisplay<'_, BrightBlack, Self>
§fn bright_red(&self) -> FgColorDisplay<'_, BrightRed, Self>
fn bright_red(&self) -> FgColorDisplay<'_, BrightRed, Self>
§fn on_bright_red(&self) -> BgColorDisplay<'_, BrightRed, Self>
fn on_bright_red(&self) -> BgColorDisplay<'_, BrightRed, Self>
§fn bright_green(&self) -> FgColorDisplay<'_, BrightGreen, Self>
fn bright_green(&self) -> FgColorDisplay<'_, BrightGreen, Self>
§fn on_bright_green(&self) -> BgColorDisplay<'_, BrightGreen, Self>
fn on_bright_green(&self) -> BgColorDisplay<'_, BrightGreen, Self>
§fn bright_yellow(&self) -> FgColorDisplay<'_, BrightYellow, Self>
fn bright_yellow(&self) -> FgColorDisplay<'_, BrightYellow, Self>
§fn on_bright_yellow(&self) -> BgColorDisplay<'_, BrightYellow, Self>
fn on_bright_yellow(&self) -> BgColorDisplay<'_, BrightYellow, Self>
§fn bright_blue(&self) -> FgColorDisplay<'_, BrightBlue, Self>
fn bright_blue(&self) -> FgColorDisplay<'_, BrightBlue, Self>
§fn on_bright_blue(&self) -> BgColorDisplay<'_, BrightBlue, Self>
fn on_bright_blue(&self) -> BgColorDisplay<'_, BrightBlue, Self>
§fn bright_magenta(&self) -> FgColorDisplay<'_, BrightMagenta, Self>
fn bright_magenta(&self) -> FgColorDisplay<'_, BrightMagenta, Self>
§fn on_bright_magenta(&self) -> BgColorDisplay<'_, BrightMagenta, Self>
fn on_bright_magenta(&self) -> BgColorDisplay<'_, BrightMagenta, Self>
§fn bright_purple(&self) -> FgColorDisplay<'_, BrightMagenta, Self>
fn bright_purple(&self) -> FgColorDisplay<'_, BrightMagenta, Self>
§fn on_bright_purple(&self) -> BgColorDisplay<'_, BrightMagenta, Self>
fn on_bright_purple(&self) -> BgColorDisplay<'_, BrightMagenta, Self>
§fn bright_cyan(&self) -> FgColorDisplay<'_, BrightCyan, Self>
fn bright_cyan(&self) -> FgColorDisplay<'_, BrightCyan, Self>
§fn on_bright_cyan(&self) -> BgColorDisplay<'_, BrightCyan, Self>
fn on_bright_cyan(&self) -> BgColorDisplay<'_, BrightCyan, Self>
§fn bright_white(&self) -> FgColorDisplay<'_, BrightWhite, Self>
fn bright_white(&self) -> FgColorDisplay<'_, BrightWhite, Self>
§fn on_bright_white(&self) -> BgColorDisplay<'_, BrightWhite, Self>
fn on_bright_white(&self) -> BgColorDisplay<'_, BrightWhite, Self>
§fn blink_fast(&self) -> BlinkFastDisplay<'_, Self>
fn blink_fast(&self) -> BlinkFastDisplay<'_, Self>
§fn strikethrough(&self) -> StrikeThroughDisplay<'_, Self>
fn strikethrough(&self) -> StrikeThroughDisplay<'_, Self>
§fn color<Color>(&self, color: Color) -> FgDynColorDisplay<'_, Color, Self>where
Color: DynColor,
fn color<Color>(&self, color: Color) -> FgDynColorDisplay<'_, Color, Self>where
Color: DynColor,
OwoColorize::fg] or
a color-specific method, such as [OwoColorize::green], Read more§fn on_color<Color>(&self, color: Color) -> BgDynColorDisplay<'_, Color, Self>where
Color: DynColor,
fn on_color<Color>(&self, color: Color) -> BgDynColorDisplay<'_, Color, Self>where
Color: DynColor,
OwoColorize::bg] or
a color-specific method, such as [OwoColorize::on_yellow], Read more