pub struct CsTable { /* private fields */ }Expand description
The control-sequence table.
Implementations§
Source§impl CsTable
impl CsTable
Sourcepub fn new() -> Self
pub fn new() -> Self
A table containing only NO_CS, NULL_CS and UNDEFINED_CS.
Sourcepub fn is_empty(&self) -> bool
pub fn is_empty(&self) -> bool
Whether the table is empty (never true: three ids are preallocated).
Sourcepub fn lookup_or_insert(&mut self, name: &[u8]) -> CsId
pub fn lookup_or_insert(&mut self, name: &[u8]) -> CsId
Looks a name up, creating the control sequence if necessary.
Sourcepub fn active(&mut self, c: u32) -> CsId
pub fn active(&mut self, c: u32) -> CsId
The id of active character c, creating it if necessary.
Sourcepub fn lookup_active(&self, c: u32) -> Option<CsId>
pub fn lookup_active(&self, c: u32) -> Option<CsId>
The id of active character c, if it exists.
Sourcepub fn new_internal(&mut self, name: &[u8]) -> CsId
pub fn new_internal(&mut self, name: &[u8]) -> CsId
Allocates an internal control sequence printed as the bare name.
Sourcepub fn new_frozen(&mut self, name: &[u8]) -> CsId
pub fn new_frozen(&mut self, name: &[u8]) -> CsId
Allocates a frozen control sequence printed as name.
Sourcepub fn name(&self, id: CsId) -> &[u8] ⓘ
pub fn name(&self, id: CsId) -> &[u8] ⓘ
The name of a control sequence (for active characters: the character’s encoding).
Sourcepub fn entries(&self) -> impl Iterator<Item = (&[u8], &CsKind)>
pub fn entries(&self) -> impl Iterator<Item = (&[u8], &CsKind)>
All entries as (name, kind) in id order, for format dumping.
Sourcepub fn from_entries(entries: Vec<(Box<[u8]>, CsKind)>) -> CsTable
pub fn from_entries(entries: Vec<(Box<[u8]>, CsKind)>) -> CsTable
Rebuilds a table from dumped entries (the inverse of
entries).
Sourcepub fn iter_named(&self) -> impl Iterator<Item = (&[u8], CsId)>
pub fn iter_named(&self) -> impl Iterator<Item = (&[u8], CsId)>
Iterates over all (name, id) pairs that can be looked up by name (excluding active characters).
Trait Implementations§
Auto Trait Implementations§
impl Freeze for CsTable
impl RefUnwindSafe for CsTable
impl Send for CsTable
impl Sync for CsTable
impl Unpin for CsTable
impl UnsafeUnpin for CsTable
impl UnwindSafe for CsTable
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