pub struct MouthRuntime {
pub autoclose: bool,
pub mouth: Mouth,
pub boundary: BalancedBoundary,
pub pushback: Vec<Token>,
}Fields§
§autoclose: bool§mouth: Mouth§boundary: BalancedBoundarySee BalancedBoundary. Only consulted when autoclose is set and the
mouth is not a file.
pushback: Vec<Token>Pushback LIFO stack: the “next to read” token is at pushback.last().
Invariant: reading pops from the back; unread_one pushes to the back;
unread_vec iterates its input in reverse and pushes each — so the
first element of an unread Vec ends up on top (= next to read).
See flush_mouth for the rare FIFO-prepend semantics (\endinput).
Previously a VecDeque<Token> — switched to a plain Vec because the
hot-path is pure LIFO and VecDeque’s push_front/pop_front machinery
(head-pointer + wrap arithmetic) showed up at ~3.3% of total Ir in
callgrind on siunitx-heavy fixtures.
Trait Implementations§
Source§impl Debug for MouthRuntime
impl Debug for MouthRuntime
Source§impl PartialEq for MouthRuntime
impl PartialEq for MouthRuntime
impl StructuralPartialEq for MouthRuntime
Auto Trait Implementations§
impl Freeze for MouthRuntime
impl RefUnwindSafe for MouthRuntime
impl Send for MouthRuntime
impl Sync for MouthRuntime
impl Unpin for MouthRuntime
impl UnsafeUnpin for MouthRuntime
impl UnwindSafe for MouthRuntime
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