Skip to main content

DefaultState

Struct DefaultState 

Source
pub struct DefaultState<ET: EngineTypes> {
    pub commands: <ET::CSName as CSName<ET::Char>>::Map<TeXCommand<ET>>,
    /* private fields */
}
Expand description

Default implementation of a plain TeX State.

Fields§

§commands: <ET::CSName as CSName<ET::Char>>::Map<TeXCommand<ET>>

Implementations§

Source§

impl<ET: EngineTypes> DefaultState<ET>

Source

pub fn set_command_direct( &mut self, name: ET::CSName, cmd: Option<TeXCommand<ET>>, )

Trait Implementations§

Source§

impl<ET: Clone + EngineTypes> Clone for DefaultState<ET>
where ET::Char: Clone, ET::Int: Clone, ET::Dim: Clone, ET::MuDim: Clone, ET::Token: Clone, ET::CSName: Clone, ET::Font: Clone,

Source§

fn clone(&self) -> DefaultState<ET>

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl<ET: EngineTypes> State<ET> for DefaultState<ET>

Source§

fn new(nullfont: ET::Font, aux: &mut EngineAux<ET>) -> Self

Instantiate a new State
Source§

fn register_primitive( &mut self, aux: &mut EngineAux<ET>, name: &'static str, cmd: PrimitiveCommand<ET>, )

register a new PrimitiveCommand. Should only be called during engine initialization.
Source§

fn primitives(&self) -> &PrimitiveCommands<ET>

return the set of all registered PrimitiveCommands.
Source§

fn get_group_type(&self) -> Option<GroupType>

The current [GroupType] (i.e. \currentgrouptype`).
Source§

fn get_group_level(&self) -> usize

The current group level/depth (0 being the top level; i.e. \currentgrouplevel)
Source§

fn aftergroup(&mut self, token: ET::Token)

Append a Token to be inserted when the current group ends (i.e. \aftergroup)
Source§

fn push( &mut self, aux: &mut EngineAux<ET>, group_type: GroupType, line_number: usize, )

push a new group level to the scoping stack; line_number is used for \tracinggroups
Source§

fn pop(&mut self, aux: &mut EngineAux<ET>, mouth: &mut ET::Mouth)

pop a group level from the scoping stack. Needs the mouth to insert the \aftergroup Tokens (if set)
Source§

fn get_parshape(&self) -> &Vec<(ET::Dim, ET::Dim)>

Get the current \parshape
Source§

fn take_parshape(&mut self) -> Vec<(ET::Dim, ET::Dim)>

Get the current \parshape and set it to its default value
Source§

fn set_parshape( &mut self, aux: &EngineAux<ET>, parshape: Vec<(ET::Dim, ET::Dim)>, globally: bool, )

Set the current \parshape
Source§

fn get_current_font(&self) -> &ET::Font

Get the current Font
Source§

fn set_current_font( &mut self, aux: &mut EngineAux<ET>, fnt: ET::Font, globally: bool, )

Set the current Font
Source§

fn get_textfont(&self, i: u8) -> &<ET as EngineTypes>::Font

Get the current \textfont for the given family number, where fam is 0..15
Source§

fn set_textfont( &mut self, aux: &mut EngineAux<ET>, idx: u8, fnt: <ET as EngineTypes>::Font, globally: bool, )

Set the current \textfont for the given family number, where fam is 0..15
Source§

fn get_scriptfont(&self, i: u8) -> &<ET as EngineTypes>::Font

Get the current \scriptfont for the given family number, where fam is 0..15
Source§

fn set_scriptfont( &mut self, aux: &mut EngineAux<ET>, idx: u8, fnt: <ET as EngineTypes>::Font, globally: bool, )

Set the current \scriptfont for the given family number, where fam is 0..15
Source§

fn get_scriptscriptfont(&self, i: u8) -> &<ET as EngineTypes>::Font

Get the current \scriptscriptfont for the given family number, where fam is 0..15
Source§

fn set_scriptscriptfont( &mut self, aux: &mut EngineAux<ET>, idx: u8, fnt: <ET as EngineTypes>::Font, globally: bool, )

Set the current \scriptscriptfont for the given family number, where fam is 0..15
Source§

fn get_catcode_scheme(&self) -> &CategoryCodeScheme<ET::Char>

Get the current CategoryCodeScheme
Source§

fn set_catcode( &mut self, aux: &EngineAux<ET>, c: ET::Char, cc: CategoryCode, globally: bool, )

Set the current CategoryCode for a character
Source§

fn get_sfcode(&self, c: ET::Char) -> u16

Get the current space factor code \sfcode for a character
Source§

fn set_sfcode( &mut self, aux: &EngineAux<ET>, c: ET::Char, val: u16, globally: bool, )

Set the current space factor code \sfcode for a character
Source§

fn get_delcode(&self, c: ET::Char) -> ET::Int

Get the current delimiter code \delcode for a character
Source§

fn set_delcode( &mut self, aux: &EngineAux<ET>, c: ET::Char, val: ET::Int, globally: bool, )

Set the current delimiter code \delcode for a character
Source§

fn get_lccode(&self, c: ET::Char) -> ET::Char

Get the current lower case code \lccode for a character
Source§

fn set_lccode( &mut self, aux: &EngineAux<ET>, c: ET::Char, val: ET::Char, globally: bool, )

Set the current lower case code \lccode for a character
Source§

fn get_uccode(&self, c: ET::Char) -> ET::Char

Get the current upper case code \uccode for a character
Source§

fn set_uccode( &mut self, aux: &EngineAux<ET>, c: ET::Char, val: ET::Char, globally: bool, )

Set the current upper case code \uccode for a character
Source§

fn get_mathcode(&self, c: ET::Char) -> u32

Get the current math code \mathcode for a character
Source§

fn set_mathcode( &mut self, aux: &EngineAux<ET>, c: ET::Char, val: u32, globally: bool, )

Set the current math code \mathcode for a character
Source§

fn get_endline_char(&self) -> Option<ET::Char>

Get the current endline character
Source§

fn set_endline_char( &mut self, aux: &EngineAux<ET>, c: Option<ET::Char>, globally: bool, )

Set the current endline character
Source§

fn get_escape_char(&self) -> Option<ET::Char>

Get the current escape character
Source§

fn set_escape_char( &mut self, aux: &EngineAux<ET>, c: Option<ET::Char>, globally: bool, )

Set the current escape character
Source§

fn get_newline_char(&self) -> Option<ET::Char>

Get the current newline character
Source§

fn set_newline_char( &mut self, aux: &EngineAux<ET>, c: Option<ET::Char>, globally: bool, )

Set the current newline character
Source§

fn get_primitive_int(&self, name: PrimitiveIdentifier) -> ET::Int

Get a primitive integer value
Source§

fn set_primitive_int( &mut self, aux: &EngineAux<ET>, name: PrimitiveIdentifier, v: ET::Int, globally: bool, )

Set a primitive integer value
Source§

fn get_int_register(&self, idx: usize) -> ET::Int

Get an integer register value
Source§

fn set_int_register( &mut self, aux: &EngineAux<ET>, idx: usize, v: ET::Int, globally: bool, )

Set an integer register value
Source§

fn get_dim_register(&self, idx: usize) -> ET::Dim

Get a dimen register value
Source§

fn set_dim_register( &mut self, aux: &EngineAux<ET>, idx: usize, v: ET::Dim, globally: bool, )

Set a dimen register value
Source§

fn get_skip_register(&self, idx: usize) -> Skip<ET::Dim>

Get a skip register value
Source§

fn set_skip_register( &mut self, aux: &EngineAux<ET>, idx: usize, v: Skip<ET::Dim>, globally: bool, )

Set a skip register value
Source§

fn get_muskip_register(&self, idx: usize) -> MuSkip<ET::MuDim>

Get a muskip register value
Source§

fn set_muskip_register( &mut self, aux: &EngineAux<ET>, idx: usize, v: MuSkip<ET::MuDim>, globally: bool, )

Set a muskip register value
Source§

fn get_box_register(&self, idx: usize) -> Option<&TeXBox<ET>>

Get a box register value
Source§

fn get_box_register_mut(&mut self, idx: usize) -> Option<&mut TeXBox<ET>>

Get a box register value mutably (to e.g. change \ht, \wd, \dp, etc.)
Source§

fn take_box_register(&mut self, idx: usize) -> Option<TeXBox<ET>>

Take a box register value; replacing it with None (i.e. void box)
Source§

fn set_box_register( &mut self, aux: &EngineAux<ET>, idx: usize, v: Option<TeXBox<ET>>, globally: bool, )

Set a box register value
Source§

fn get_toks_register(&self, idx: usize) -> &TokenList<ET::Token>

Get a token register value
Source§

fn set_toks_register( &mut self, aux: &EngineAux<ET>, idx: usize, v: TokenList<ET::Token>, globally: bool, )

Set a token register value
Source§

fn get_primitive_tokens( &self, name: PrimitiveIdentifier, ) -> &TokenList<ET::Token>

Get a primitive token list
Source§

fn set_primitive_tokens( &mut self, aux: &EngineAux<ET>, name: PrimitiveIdentifier, v: TokenList<ET::Token>, globally: bool, )

Set a primitive token list
Source§

fn get_primitive_dim(&self, name: PrimitiveIdentifier) -> ET::Dim

Get a primitive dimension value
Source§

fn set_primitive_dim( &mut self, aux: &EngineAux<ET>, name: PrimitiveIdentifier, v: ET::Dim, globally: bool, )

Set a primitive dimension value
Source§

fn get_primitive_skip(&self, name: PrimitiveIdentifier) -> Skip<ET::Dim>

Get a primitive skip value
Source§

fn set_primitive_skip( &mut self, aux: &EngineAux<ET>, name: PrimitiveIdentifier, v: Skip<ET::Dim>, globally: bool, )

Set a primitive skip value
Source§

fn get_primitive_muskip(&self, name: PrimitiveIdentifier) -> MuSkip<ET::MuDim>

Get a primitive muskip value
Source§

fn set_primitive_muskip( &mut self, aux: &EngineAux<ET>, name: PrimitiveIdentifier, v: MuSkip<ET::MuDim>, globally: bool, )

Set a primitive muskip value
Source§

fn get_command(&self, name: &ET::CSName) -> Option<&TeXCommand<ET>>

Get the current definition for the control sequence name
Source§

fn set_command( &mut self, aux: &EngineAux<ET>, name: ET::CSName, cmd: Option<TeXCommand<ET>>, globally: bool, )

Set the current definition for the control sequence name
Source§

fn get_ac_command(&self, c: ET::Char) -> Option<&TeXCommand<ET>>

Get the current definition for the active character
Source§

fn set_ac_command( &mut self, _aux: &EngineAux<ET>, c: ET::Char, cmd: Option<TeXCommand<ET>>, globally: bool, )

Set the current definition for the active character
Source§

fn register_index(i: ET::Int) -> Option<usize>

convert the provided integer value into a legal index for a register (or None if out of range)
Source§

fn get_mathfonts(&self, fam: u8) -> (ET::Font, ET::Font, ET::Font)

Get the current set of mathfonts (text, script, scriptscript) for the given family number, where fam is 0..15
Source§

impl<ET: EngineTypes> StateChangeTracker<ET> for DefaultState<ET>

Source§

fn stack(&mut self) -> &mut StateStack<ET>

Get the current StateStack
Source§

fn change_field<F: FnOnce(&mut Self, bool) -> StateChange<ET>>( &mut self, globally: bool, f: F, )

Change a field of the state, and add the change to the StateStack. Also takes care of inspecting and considering the current \globaldefs value and passes on the actual computed globally value to the continuation function, which should return the StateChange containg the old value. Read more

Auto Trait Implementations§

§

impl<ET> Freeze for DefaultState<ET>

§

impl<ET> !RefUnwindSafe for DefaultState<ET>

§

impl<ET> Send for DefaultState<ET>
where <<ET as EngineTypes>::Char as Character>::CharMap<CategoryCode>: Send, <<ET as EngineTypes>::Char as Character>::CharMap<u16>: Send, <<ET as EngineTypes>::Char as Character>::CharMap<<ET as EngineTypes>::Char>: Send, <<ET as EngineTypes>::Char as Character>::CharMap<u32>: Send, <<ET as EngineTypes>::Char as Character>::CharMap<<ET as EngineTypes>::Int>: Send, <<ET as EngineTypes>::CSName as CSName<<ET as EngineTypes>::Char>>::Map<TeXCommand<ET>>: Send, <<ET as EngineTypes>::Char as Character>::CharMap<Option<TeXCommand<ET>>>: Send, <ET as EngineTypes>::Font: Send, <ET as EngineTypes>::Char: Send, <ET as EngineTypes>::Int: Send, <ET as EngineTypes>::Dim: Send, <ET as EngineTypes>::MuDim: Send, <<ET as EngineTypes>::File as File>::SourceRefID: Send, <ET as EngineTypes>::CSName: Send, <ET as EngineTypes>::CustomNode: Send, ET: Send,

§

impl<ET> !Sync for DefaultState<ET>

§

impl<ET> Unpin for DefaultState<ET>

§

impl<ET> UnsafeUnpin for DefaultState<ET>

§

impl<ET> UnwindSafe for DefaultState<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> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. 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> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
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