Skip to main content

DefaultGullet

Struct DefaultGullet 

Source
pub struct DefaultGullet<ET: EngineTypes> { /* private fields */ }
Expand description

Default implementation of a Gullet.

Trait Implementations§

Source§

impl<ET: EngineTypes> Gullet<ET> for DefaultGullet<ET>

Source§

fn new( _aux: &mut EngineAux<ET>, _state: &mut ET::State, _mouth: &mut ET::Mouth, ) -> Self

Instantiate a new Gullet
Source§

fn csnames(&mut self) -> &mut usize

Get a mutable reference to the counter for the number of \csnames we are currently in
Source§

fn push_align(&mut self, ad: AlignData<ET::Token, ET::Dim>)

Push a new AlignData onto the stack, i.e. on \halign or \valign
Source§

fn pop_align(&mut self) -> Option<AlignData<ET::Token, ET::Dim>>

Pop the last AlignData from the stack, i.e. at the end of \halign or \valign
Source§

fn do_macro( engine: &mut EngineReferences<'_, ET>, m: Macro<ET::Token>, token: ET::Token, ) -> TeXResult<(), ET>

Expand the given Macro with its given expansion function.
Source§

fn get_align_data(&mut self) -> Option<&mut AlignData<ET::Token, ET::Dim>>

Inspect the current AlignData, if any (i.e. if we are in an \halign or \valign)
Source§

fn get_conditional(&self) -> Option<ActiveConditional<ET::Int>>

Inspect the current ActiveConditional, if any (i.e. if we are in an \if or similar)
Source§

fn get_conditionals(&mut self) -> &mut Vec<ActiveConditional<ET::Int>>

Get a mutable reference to the stack of ActiveConditionals
Source§

fn iterate<R, E, F: FnMut(&mut EngineAux<ET>, &ET::State, ET::Token) -> TeXResult<Option<R>, ET>>( &mut self, mouth: &mut ET::Mouth, aux: &mut EngineAux<ET>, state: &ET::State, cont: F, eof: E, ) -> TeXResult<R, ET>
where E: Fn(&EngineAux<ET>, &ET::State, &mut ET::Mouth) -> TeXResult<(), ET>,

Wrapper around Mouth::iterate that, in case we are in an \halign or \valign, make sure to replace &, \cr etc. with the appropriate tokens. See also EngineReferences::iterate.
Source§

fn get_next( &mut self, mouth: &mut ET::Mouth, aux: &mut EngineAux<ET>, state: &ET::State, noexpand: bool, ) -> Result<Option<ET::Token>, GulletError<ET::Char>>

Wrapper around Mouth::get_next that, in case we are in an \halign or \valign, make sure to replace &, \cr etc. with the appropriate tokens. If noexpand is true, \cr, \crcr and & are not expanded. See also EngineReferences::get_next.
Source§

fn read_until_endgroup<E, F: FnMut(&mut EngineAux<ET>, &ET::State, ET::Token) -> TeXResult<(), ET>>( &mut self, mouth: &mut ET::Mouth, aux: &mut EngineAux<ET>, state: &ET::State, cont: F, eof: E, ) -> TeXResult<ET::Token, ET>
where E: Fn(&EngineAux<ET>, &ET::State, &mut ET::Mouth) -> TeXResult<(), ET>,

Wrapper around Mouth::read_until_endgroup that, in case we are in an \halign or \valign, make sure to replace &, \cr etc. with the appropriate tokens. See also EngineReferences::read_until_endgroup.
Source§

fn requeue( &mut self, aux: &EngineAux<ET>, state: &ET::State, mouth: &mut ET::Mouth, t: ET::Token, ) -> TeXResult<(), ET>

Wrapper around Mouth::requeue that makes sure to update the AlignData if we are in an \halign or \valign. See also EngineReferences::requeue.
Source§

fn read_int( engine: &mut EngineReferences<'_, ET>, skip_eq: bool, in_token: &ET::Token, ) -> TeXResult<ET::Int, ET>

Read an integer from the input stream. See also EngineReferences::read_int.
Source§

fn read_dim( engine: &mut EngineReferences<'_, ET>, skip_eq: bool, in_token: &ET::Token, ) -> TeXResult<ET::Dim, ET>

Read a dimension value from the input stream. See also EngineReferences::read_dim.
Source§

fn read_skip( engine: &mut EngineReferences<'_, ET>, skip_eq: bool, in_token: &ET::Token, ) -> TeXResult<Skip<ET::Dim>, ET>

Read a skip value from the input stream. See also EngineReferences::read_skip.
Source§

fn read_muskip( engine: &mut EngineReferences<'_, ET>, skip_eq: bool, in_token: &ET::Token, ) -> TeXResult<MuSkip<ET::MuDim>, ET>

Read a muskip value from the input stream. See also EngineReferences::read_muskip.
Source§

fn read_mudim( engine: &mut EngineReferences<'_, ET>, skip_eq: bool, in_token: &ET::Token, ) -> TeXResult<ET::MuDim, ET>

Read a mudim value from the input stream (for \mkern). See also EngineReferences::read_mudim.
Source§

fn read_string( engine: &mut EngineReferences<'_, ET>, skip_eq: bool, target: &mut String, in_token: &ET::Token, ) -> TeXResult<(), ET>

Read a string from the input stream. See also EngineReferences::read_string.
Source§

fn read_maybe_braced_string( engine: &mut EngineReferences<'_, ET>, skip_eq: bool, target: &mut String, in_token: &ET::Token, ) -> TeXResult<(), ET>

Source§

fn read_keyword( engine: &mut EngineReferences<'_, ET>, kw: &[u8], ) -> TeXResult<bool, ET>

Check whether the input stream starts with the given keyword. See also EngineReferences::read_keyword.
Source§

fn read_keywords<'a>( engine: &mut EngineReferences<'_, ET>, kw: &'a [&'a [u8]], ) -> TeXResult<Option<&'a [u8]>, ET>

Check whether the input stream starts with one of the given keywords. See also EngineReferences::read_keywords.
Source§

fn read_chars( engine: &mut EngineReferences<'_, ET>, kws: &[u8], ) -> TeXResult<Either<u8, Option<ET::Token>>, ET>

Check whether the next character is one of the provided ones. See also EngineReferences::read_chars.
Source§

fn resolve<'a>(state: &'a ET::State, token: &ET::Token) -> ResolvedToken<'a, ET>

Inspect the given Token and return its current definition, if any. See also EngineReferences::resolve.
Source§

fn char_or_primitive( state: &ET::State, token: &ET::Token, ) -> Option<CharOrPrimitive<ET>>

Inspects the Token and returns either the PrimitiveIdentifier or the Character and CommandCode or None if the token is neither a primitive nor a character. Useful for e.g. quick checks in an \halign whether the token is a specific primitive (\cr,\crcr,\span) or a character (&, space).
Source§

fn do_expandable( engine: &mut EngineReferences<'_, ET>, name: PrimitiveIdentifier, token: ET::Token, f: fn(&mut EngineReferences<'_, ET>, &mut Vec<ET::Token>, ET::Token) -> TeXResult<(), ET>, ) -> TeXResult<(), ET>

Expand the given expandable Token with its given expansion function. See also Expandable.
Source§

fn do_simple_expandable( engine: &mut EngineReferences<'_, ET>, name: PrimitiveIdentifier, token: ET::Token, f: fn(&mut EngineReferences<'_, ET>, ET::Token) -> TeXResult<(), ET>, ) -> TeXResult<(), ET>

Expand the given expandable Token with its given simple expansion function. See also SimpleExpandable.
Source§

fn do_conditional( engine: &mut EngineReferences<'_, ET>, name: PrimitiveIdentifier, token: ET::Token, f: fn(&mut EngineReferences<'_, ET>, ET::Token) -> TeXResult<bool, ET>, unless: bool, ) -> TeXResult<(), ET>

Expand the given conditional. See also Conditional
Source§

fn expand_until_endgroup<Fn: FnMut(&mut EngineAux<ET>, &ET::State, ET::Token) -> TeXResult<(), ET>>( engine: &mut EngineReferences<'_, ET>, expand_protected: bool, edef_like: bool, token: &ET::Token, cont: Fn, ) -> TeXResult<(), ET>

Expand Tokens until encountering an EndGroup-token. See also EngineReferences::expand_until_endgroup.

Auto Trait Implementations§

§

impl<ET> Freeze for DefaultGullet<ET>

§

impl<ET> RefUnwindSafe for DefaultGullet<ET>

§

impl<ET> Send for DefaultGullet<ET>
where ET: Send, <ET as EngineTypes>::Int: Send, <ET as EngineTypes>::Dim: Send,

§

impl<ET> Sync for DefaultGullet<ET>
where ET: Sync, <ET as EngineTypes>::Int: Sync, <ET as EngineTypes>::Dim: Sync,

§

impl<ET> Unpin for DefaultGullet<ET>
where ET: Unpin, <ET as EngineTypes>::Token: Unpin, <ET as EngineTypes>::Int: Unpin,

§

impl<ET> UnsafeUnpin for DefaultGullet<ET>

§

impl<ET> UnwindSafe for DefaultGullet<ET>

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

§

impl<T> Instrument for T

§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided [Span], returning an Instrumented wrapper. Read more
§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> IntoEither for T

Source§

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 more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

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
Source§

impl<ET, Err, A> IntoErr<ET, Err> for A
where ET: EngineTypes, Err: From<A>,

Source§

fn into_err( self, _aux: &EngineAux<ET>, _state: &<ET as EngineTypes>::State, ) -> Err

§

impl<T> Pointable for T

§

const ALIGN: usize

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
§

impl<T> PolicyExt for T
where T: ?Sized,

§

fn and<P, B, E>(self, other: P) -> And<T, P>
where T: Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns [Action::Follow] only if self and other return Action::Follow. Read more
§

fn or<P, B, E>(self, other: P) -> Or<T, P>
where T: Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns [Action::Follow] if either self or other returns Action::Follow. Read more
Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<T> WithSubscriber for T

§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a [WithDispatch] wrapper. Read more
§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a [WithDispatch] wrapper. Read more