pub struct CodeTable { /* private fields */ }Expand description
A table of per-character codes with a default function.
Storage is a two-level page table: 256-character pages, allocated on first assignment and filled with the defaults. Lookups are two array indexings, with no hashing, which matters because the scanner consults these tables for every character.
Implementations§
Source§impl CodeTable
impl CodeTable
Sourcepub fn new(default: fn(u32) -> i64) -> Self
pub fn new(default: fn(u32) -> i64) -> Self
A table where every character has value default(c).
Sourcepub fn define_in_place(&mut self, c: u32, val: i64, cur: u16) -> bool
pub fn define_in_place(&mut self, c: u32, val: i64, cur: u16) -> bool
Assigns val to c at level cur when that needs no save-stack
entry (the value is unchanged, or was defined at level cur, or
cur is level one). Returns false, changing nothing, otherwise.
Sourcepub fn default_fn(&self) -> fn(u32) -> i64
pub fn default_fn(&self) -> fn(u32) -> i64
The default function of this table.
Sourcepub fn dump_pages(&self) -> Vec<(usize, [i64; 256])>
pub fn dump_pages(&self) -> Vec<(usize, [i64; 256])>
The values of every allocated page that differs from the defaults, as (page number, values), for format dumping.
Trait Implementations§
Auto Trait Implementations§
impl !Send for CodeTable
impl !Sync for CodeTable
impl Freeze for CodeTable
impl RefUnwindSafe for CodeTable
impl Unpin for CodeTable
impl UnsafeUnpin for CodeTable
impl UnwindSafe for CodeTable
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