pub trait ConvertSymbols<Sym, Error> {
// Required methods
fn process_symbol(&mut self, symbol: Sym) -> Result<Option<&[u8]>, Error>;
fn process_tail(&mut self) -> Result<Option<&[u8]>, Error>;
}
Expand description
A type that helps convert the symbols in presentation format.
This trait is used by Scanner::convert_token
with Symbol
s and
Scanner::convert_entry
with [EntrySymbol]
s.
For each symbol, process_symbol
is
called. When the end of token or entry is reached,
process_tail
is called, giving the
implementer a chance to return any remaining data.
Required Methods§
sourcefn process_symbol(&mut self, symbol: Sym) -> Result<Option<&[u8]>, Error>
fn process_symbol(&mut self, symbol: Sym) -> Result<Option<&[u8]>, Error>
Processes the next symbol.
If the method returns some data, it will be appended to the output octets sequence.
sourcefn process_tail(&mut self) -> Result<Option<&[u8]>, Error>
fn process_tail(&mut self) -> Result<Option<&[u8]>, Error>
Process the end of token.
If the method returns some data, it will be appended to the output octets sequence.