Trait domain::base::scan::ConvertSymbols

source ·
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 Symbols 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§

source

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.

source

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.

Implementors§

source§

impl<Sym, Error> ConvertSymbols<Sym, Error> for domain::utils::base16::SymbolConverter
where Sym: Into<EntrySymbol>, Error: ScannerError,

source§

impl<Sym, Error> ConvertSymbols<Sym, Error> for domain::utils::base32::SymbolConverter
where Sym: Into<EntrySymbol>, Error: ScannerError,

source§

impl<Sym, Error> ConvertSymbols<Sym, Error> for domain::utils::base64::SymbolConverter
where Sym: Into<EntrySymbol>, Error: ScannerError,