pub enum IText<I = String> {
Text(String),
CodeText(String),
Cmd {
name: I,
span: Span,
args: Vec<CmdArg<I>>,
},
Embed {
expr: Ast<I>,
span: Span,
},
EmbedMath {
elems: Rc<Vec<MathElem<I>>>,
span: Span,
},
}Expand description
One inline-text element (input_horz_element).
Variants§
Text(String)
CodeText(String)
A backtick literal inside inline text (`…`;
UTInputHorzEmbeddedCodeText). Kept apart from Text because the
context’s installed code-text command decides how it is set — see
Context::code_text_command and read_inline’s arm.
Cmd
Fields
name: ISigil included (\emph), matching the environment entry.
Embed
#expr; — an embedded expression evaluating to inline-text, spliced
in place (UTInputHorzContent).
EmbedMath
${…} embedded math (UTInputHorzEmbeddedMath). read_inline’s
EmbedMath arm applies the context’s installed [math] inline-cmd
(Context::math_command) to (ctx, math value), exactly like
upstream — \cmd/#var inside the literal go through
reflect_math_elem/as_math. Contexts with no installed command
(built by Context::initial directly, i.e. unit tests) fall back to
reflecting + laying out directly.
Implementations§
Trait Implementations§
impl<I: PartialEq> StructuralPartialEq for IText<I>
Auto Trait Implementations§
impl<I = String> !Send for IText<I>
impl<I = String> !Sync for IText<I>
impl<I> Freeze for IText<I>
impl<I> RefUnwindSafe for IText<I>where
I: RefUnwindSafe,
Vec<CmdArg<I>>: RefUnwindSafe,
Ast<I>: RefUnwindSafe,
Rc<Vec<MathElem<I>>>: RefUnwindSafe,
impl<I> Unpin for IText<I>
impl<I> UnsafeUnpin for IText<I>where
I: UnsafeUnpin,
Vec<CmdArg<I>>: UnsafeUnpin,
Ast<I>: UnsafeUnpin,
Rc<Vec<MathElem<I>>>: UnsafeUnpin,
impl<I> UnwindSafe for IText<I>where
I: UnwindSafe,
Vec<CmdArg<I>>: UnwindSafe,
Ast<I>: UnwindSafe,
Rc<Vec<MathElem<I>>>: UnwindSafe,
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more