Trait symtern::traits::Resolve [] [src]

pub trait Resolve {
    type Input;
    type Output;
    fn resolve(self, symbol: Self::Input) -> Result<Self::Output>;
}

Interface trait for types that provide the ability to resolve a symbol into its referent.

In order to allow for implementations that require a lifetime parameter, this trait's methods take self by value; for a given type T, the trait should implemented for &'a T.

Associated Types

Type passed to the resolve method.

Type stored by the interner and made available with resolve.

Required Methods

Look up and return a reference to the value represented by a symbol, or an error if the symbol was not found.

let s = match some_pool.resolve(sym) {
    Ok(s) => s,
    Err(err) => return Err(MyErrorType::from(err)),
};

Implementors