Skip to main content

ConvertSymbols

Trait 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.

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

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,