pub struct TransitionLayout {
lookup_tables: HashMap<StateID, LookupTable>,
}
Expand description
This struct contains the layout for the lookup tables used by the
TransitionFunctions
.
Each transition function may have a differently shaped lookup table.
- For [
Transition
]s, there is no lookup table and we just embed thestart
andend
directly into the function. - For [
SparseTransitions
]s, the table is represented as 2 arrays. The first array thestart
end
tuples from the [Transition
]s. The second array contains the [StateID
]s arranged to match the same order as the tuples. - For [
DenseTransitions
], it will be an array of length 256 containing [StateID
]s.
Fields§
§lookup_tables: HashMap<StateID, LookupTable>
Implementations§
Source§impl TransitionLayout
impl TransitionLayout
Sourcepub fn new(
ctx: &mut CompileContext,
overall: Layout,
) -> Result<(Layout, Self), LayoutError>
pub fn new( ctx: &mut CompileContext, overall: Layout, ) -> Result<(Layout, Self), LayoutError>
Creates a new TransitionLayout
by calculating the memory offsets for
transition lookup tables.
fn get(&self, sid: StateID) -> Option<LookupTable>
Trait Implementations§
Auto Trait Implementations§
impl Freeze for TransitionLayout
impl RefUnwindSafe for TransitionLayout
impl Send for TransitionLayout
impl Sync for TransitionLayout
impl Unpin for TransitionLayout
impl UnwindSafe for TransitionLayout
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