pub struct Macro<T: Token> {
pub protected: bool,
pub long: bool,
pub outer: bool,
pub expansion: TokenList<T>,
pub signature: MacroSignature<T>,
}Expand description
A macro, e.g. the result of \def\foo#1#2{...}.
Fields§
§protected: boolWhether the macro is protected, e.g. the result of \protected\def.
long: boolWhether the macro is long, e.g. the result of \long\def.
outer: boolWhether the macro is outer, e.g. the result of \outer\def.
expansion: TokenList<T>The expansion of the macro, e.g. ... in \def\foo#1#2{...}.
signature: MacroSignature<T>The signatureof the macro, e.g. #1#2 in \def\foo#1#2{...}.
Implementations§
Source§impl<T: Token> Macro<T>
impl<T: Token> Macro<T>
Sourcepub fn new<Sig: AsRef<str>, Exp: AsRef<str>, ET: EngineTypes<Token = T, Char = T::Char>>(
int: &mut <T::CS as CSName<T::Char>>::Handler,
cc: &CategoryCodeScheme<T::Char>,
sig: Sig,
exp: Exp,
) -> TeXResult<Self, ET>
pub fn new<Sig: AsRef<str>, Exp: AsRef<str>, ET: EngineTypes<Token = T, Char = T::Char>>( int: &mut <T::CS as CSName<T::Char>>::Handler, cc: &CategoryCodeScheme<T::Char>, sig: Sig, exp: Exp, ) -> TeXResult<Self, ET>
Convenience method for creating a new macro from a signature and expansion as strings; given the provided CategoryCodeScheme.
Allows for e.g. as_point = Macro::new(int,&DEFAULT_SCHEME_U8,"#1#2","(#1,#2)").
§Errors
on invalid tex strings
Trait Implementations§
Auto Trait Implementations§
impl<T> Freeze for Macro<T>
impl<T> RefUnwindSafe for Macro<T>where
T: RefUnwindSafe,
impl<T> Send for Macro<T>where
T: Sync,
impl<T> Sync for Macro<T>
impl<T> Unpin for Macro<T>where
T: Unpin,
impl<T> UnsafeUnpin for Macro<T>
impl<T> UnwindSafe for Macro<T>where
T: 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
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
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>
Converts
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>
Converts
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