pub enum DecodeNode<L> {
Branch(Box<DecodeNode<L>>, Box<DecodeNode<L>>),
StringTerminator,
MysteryChar(u8),
MysteryString(MysteryString),
UnicodeChar(char),
Utf32String(Utf32String),
IndirectRef(LabelRef<L>),
DoubleIndirectRef(LabelRef<L>),
IndirectRefWithArgs(LabelRef<L>, Vec<DecodeArg<L>>),
DoubleIndirectRefWithArgs(LabelRef<L>, Vec<DecodeArg<L>>),
}
Expand description
A node in a decoding table.
Variants§
Branch(Box<DecodeNode<L>>, Box<DecodeNode<L>>)
Branch left on 0, right on 1.
StringTerminator
Terminate decoding.
MysteryChar(u8)
Emit a character whose encoding is unspecified and determined by the IO system (but probably Latin-1).
MysteryString(MysteryString)
Emit a string whose encoding is unspecified and determined by the IO system (but probably Latin-1).
UnicodeChar(char)
Emit a Unicode character.
Utf32String(Utf32String)
Emit a Unicode string.
IndirectRef(LabelRef<L>)
Emit the string or call the function found by dereferencing the given address.
DoubleIndirectRef(LabelRef<L>)
Emit the string or call the function found by doubly dereferencing the given address.
IndirectRefWithArgs(LabelRef<L>, Vec<DecodeArg<L>>)
Call the function found by derefencing the given address, passing it the given arguments.
DoubleIndirectRefWithArgs(LabelRef<L>, Vec<DecodeArg<L>>)
Call the function found by doubly derefencing the given address, passing it the given arguments.
Implementations§
Source§impl<L> DecodeNode<L>
impl<L> DecodeNode<L>
Sourcepub fn map<F, M>(self, f: F) -> DecodeNode<M>where
F: FnMut(L) -> M,
pub fn map<F, M>(self, f: F) -> DecodeNode<M>where
F: FnMut(L) -> M,
Applies the given mapping function to all labels within the node.
Trait Implementations§
Source§impl<L: Clone> Clone for DecodeNode<L>
impl<L: Clone> Clone for DecodeNode<L>
Source§fn clone(&self) -> DecodeNode<L>
fn clone(&self) -> DecodeNode<L>
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreAuto Trait Implementations§
impl<L> !Freeze for DecodeNode<L>
impl<L> RefUnwindSafe for DecodeNode<L>where
L: RefUnwindSafe,
impl<L> Send for DecodeNode<L>where
L: Send,
impl<L> Sync for DecodeNode<L>where
L: Sync,
impl<L> Unpin for DecodeNode<L>where
L: Unpin,
impl<L> UnwindSafe for DecodeNode<L>where
L: 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