pub struct FallbackDef {
pub owner: FeatureName,
pub modes: Vec<Mode>,
pub kind: FallbackKind,
pub element: Arc<ElementSpec>,
}Expand description
A fallback: a feature’s declaration of what a macro or an environment that no declaration defines means, in the parsing modes the fallback lists.
In those modes, such a command of the fallback’s kind
(kind) resolves to a specification that takes no argument
and carries element, and the parse reports nothing. A mathematics feature
uses a fallback to accept any command name inside \(…\) as content for
the mathematics renderer, while text mode still reports an unknown command.
Only one fallback may apply to one kind in one parsing mode across a
registry: a later fallback that overlaps an earlier one is reported as a
MintError::Clash and not installed. The
language has its own two fallbacks, consulted after every fallback a
feature declares, which apply in every mode and report the unknown command;
their nodes carry UNKNOWN_MACRO or
UNKNOWN_ENVIRONMENT. A feature
declares a fallback with
FeatureBuilder::fallback;
FlmFallbackProvider applies them.
Fields§
§owner: FeatureNameThe feature that declares the fallback; the feature builder sets it.
modes: Vec<Mode>The parsing modes in which the fallback applies.
kind: FallbackKindThe callable kind the fallback applies to.
element: Arc<ElementSpec>The element that the node of such a command carries.
Trait Implementations§
Source§impl Clone for FallbackDef
impl Clone for FallbackDef
Auto Trait Implementations§
impl !RefUnwindSafe for FallbackDef
impl !UnwindSafe for FallbackDef
impl Forget for FallbackDef
impl Freeze for FallbackDefwhere
*const ArcInner<str> is !null: Freeze,
PhantomData<ArcInner<str>>: Freeze,
*const u8 is !null: Freeze,
PhantomData<Mode>: Freeze,
*const ArcInner<ElementSpec> is !null: Freeze,
PhantomData<ArcInner<ElementSpec>>: Freeze,
impl Move for FallbackDef
impl Send for FallbackDef
impl Sync for FallbackDef
impl Unpin for FallbackDef
impl UnsafeUnpin for FallbackDefwhere
*const ArcInner<str> is !null: UnsafeUnpin,
PhantomData<ArcInner<str>>: UnsafeUnpin,
*const u8 is !null: UnsafeUnpin,
PhantomData<Mode>: UnsafeUnpin,
*const ArcInner<ElementSpec> is !null: UnsafeUnpin,
PhantomData<ArcInner<ElementSpec>>: UnsafeUnpin,
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> CheckedAs for T
impl<T> CheckedAs for T
Source§fn checked_as<Dst>(self) -> Option<Dst>where
T: CheckedCast<Dst>,
fn checked_as<Dst>(self) -> Option<Dst>where
T: CheckedCast<Dst>,
Source§impl<Src, Dst> CheckedCastFrom<Src> for Dstwhere
Src: CheckedCast<Dst>,
impl<Src, Dst> CheckedCastFrom<Src> for Dstwhere
Src: CheckedCast<Dst>,
Source§fn checked_cast_from(src: Src) -> Option<Dst>
fn checked_cast_from(src: Src) -> Option<Dst>
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