Struct texlang::vm::ExecutionInput
source · #[repr(transparent)]pub struct ExecutionInput<S>(/* private fields */);
Expand description
Input type for execution primitives.
This type provides:
-
Access to the input stream (with or without expansion). Its implementation of the TokenStream trait returns expanded tokens. To read the input stream without performing expansion, use the unexpanded method.
-
Mutable access to the state and the commands map the ExecutionInput::state_mut and ExecutionInput::commands_map_mut methods.
Implementations§
source§impl<S> ExecutionInput<S>
impl<S> ExecutionInput<S>
sourcepub fn new(vm: &mut VM<S>) -> &mut ExecutionInput<S>
pub fn new(vm: &mut VM<S>) -> &mut ExecutionInput<S>
Creates a mutable reference to this type from the VM type.
pub fn unexpanded(&mut self) -> &mut UnexpandedStream<S>
pub fn commands_map_mut(&mut self) -> &mut Map<S>
sourcepub fn tracer_mut(&mut self) -> &mut Tracer
pub fn tracer_mut(&mut self) -> &mut Tracer
Returns a mutable reference to the tracer.
sourcepub fn vm_parts(&mut self) -> Parts<'_, S>
pub fn vm_parts(&mut self) -> Parts<'_, S>
Returns a vm::Parts struct contains mutable references to different parts of the VM.
pub fn begin_group(&mut self)
pub fn end_group(&mut self, token: Token) -> Result<(), Box<Error>>
sourcepub fn return_token_buffer(&mut self, token_buffer: Vec<Token>)
pub fn return_token_buffer(&mut self, token_buffer: Vec<Token>)
Return a token buffer, allowing it to be reused.
Trait Implementations§
source§impl<S> AsMut<ExpandedStream<S>> for ExecutionInput<S>
impl<S> AsMut<ExpandedStream<S>> for ExecutionInput<S>
source§fn as_mut(&mut self) -> &mut ExpandedStream<S>
fn as_mut(&mut self) -> &mut ExpandedStream<S>
Converts this type into a mutable reference of the (usually inferred) input type.
source§impl<S: TexlangState> TokenStream for ExecutionInput<S>
impl<S: TexlangState> TokenStream for ExecutionInput<S>
source§fn next(&mut self) -> Result<Option<Token>, Box<Error>>
fn next(&mut self) -> Result<Option<Token>, Box<Error>>
Gets the next token in the stream. Read more
source§fn peek(&mut self) -> Result<Option<&Token>, Box<Error>>
fn peek(&mut self) -> Result<Option<&Token>, Box<Error>>
Peeks at the next token in the stream without removing it. Read more
source§fn consume(&mut self) -> Result<(), Box<Error>>
fn consume(&mut self) -> Result<(), Box<Error>>
Consumes the next token in the stream without returning it. Read more
source§fn commands_map(&self) -> &Map<Self::S>
fn commands_map(&self) -> &Map<Self::S>
Returns a reference to the commands map.
fn trace(&self, token: Token) -> SourceCodeTrace
fn trace_end_of_input(&self) -> SourceCodeTrace
Auto Trait Implementations§
impl<S> !RefUnwindSafe for ExecutionInput<S>
impl<S> !Send for ExecutionInput<S>
impl<S> !Sync for ExecutionInput<S>
impl<S> Unpin for ExecutionInput<S>where S: Unpin,
impl<S> UnwindSafe for ExecutionInput<S>where S: 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