TermExt

Trait TermExt 

Source
pub trait TermExt {
    // Required methods
    fn as_atom(&self) -> Option<&Atom>;
    fn get_integer(&self) -> Option<i128>;
    fn get_binary(&self) -> Option<&[u8]>;
    fn get_list(&self) -> Option<&[Term]>;
    fn get_string(&self) -> Option<String>;
    fn get_term_map(&self) -> Option<TermMap>;
    fn parse_list<T, E>(&self, parser: impl Fn(&[u8]) -> Result<T, E>) -> Vec<T>
       where E: Display;
}
Expand description

DEPRECATED: Lightweight helpers for ETF Term manipulation (legacy) Use vecpak::VecpakExt trait instead for the primary vecpak format. This trait is kept for backwards compatibility with legacy ETF code only.

Required Methods§

Source

fn as_atom(&self) -> Option<&Atom>

Source

fn get_integer(&self) -> Option<i128>

Source

fn get_binary(&self) -> Option<&[u8]>

Source

fn get_list(&self) -> Option<&[Term]>

Source

fn get_string(&self) -> Option<String>

Source

fn get_term_map(&self) -> Option<TermMap>

Source

fn parse_list<T, E>(&self, parser: impl Fn(&[u8]) -> Result<T, E>) -> Vec<T>
where E: Display,

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementations on Foreign Types§

Source§

impl TermExt for Term

Source§

fn as_atom(&self) -> Option<&Atom>

Source§

fn get_integer(&self) -> Option<i128>

Source§

fn get_binary(&self) -> Option<&[u8]>

Source§

fn get_list(&self) -> Option<&[Term]>

Source§

fn get_string(&self) -> Option<String>

Source§

fn get_term_map(&self) -> Option<TermMap>

Source§

fn parse_list<T, E>(&self, parser: impl Fn(&[u8]) -> Result<T, E>) -> Vec<T>
where E: Display,

Implementors§