Trait byte_fmt::eval::Scope

source ·
pub trait Scope {
    // Required methods
    fn lookup_apply(
        &self,
        id: &[u8],
        inp_and_args: &[&[u8]],
        init: bool,
        ctx: &dyn Scope
    ) -> ApplyResult<Vec<u8, Global>>;
    fn encode(
        &self,
        id: &[u8],
        options: &[ABE],
        bytes: &[u8]
    ) -> ApplyResult<String>;

    // Provided methods
    fn lookup_eval(
        &self,
        _id: &[u8],
        _abe: &[ABE],
        _ctx: &dyn Scope
    ) -> ApplyResult<Vec<u8, Global>> { ... }
    fn describe(
        &self,
        cb: &mut dyn FnMut(&str, &str, &mut dyn Iterator<Item = ScopeFuncInfo>, &mut dyn Iterator<Item = ScopeEvalInfo>)
    ) { ... }
}

Required Methods§

source

fn lookup_apply( &self, id: &[u8], inp_and_args: &[&[u8]], init: bool, ctx: &dyn Scope ) -> ApplyResult<Vec<u8, Global>>

source

fn encode( &self, id: &[u8], options: &[ABE], bytes: &[u8] ) -> ApplyResult<String>

Provided Methods§

source

fn lookup_eval( &self, _id: &[u8], _abe: &[ABE], _ctx: &dyn Scope ) -> ApplyResult<Vec<u8, Global>>

source

fn describe( &self, cb: &mut dyn FnMut(&str, &str, &mut dyn Iterator<Item = ScopeFuncInfo>, &mut dyn Iterator<Item = ScopeEvalInfo>) )

Trait Implementations§

source§

impl Scope for &dyn Scope

source§

fn lookup_eval( &self, id: &[u8], abe: &[ABE], scopes: &dyn Scope ) -> ApplyResult<Vec<u8, Global>>

source§

fn lookup_apply( &self, id: &[u8], inpt_and_args: &[&[u8]], init: bool, ctx: &dyn Scope ) -> ApplyResult<Vec<u8, Global>>

source§

fn describe( &self, cb: &mut dyn FnMut(&str, &str, &mut dyn Iterator<Item = ScopeFuncInfo>, &mut dyn Iterator<Item = ScopeEvalInfo>) )

source§

fn encode( &self, id: &[u8], options: &[ABE], bytes: &[u8] ) -> ApplyResult<String>

Implementations on Foreign Types§

source§

impl Scope for ()

source§

fn lookup_apply( &self, _id: &[u8], _args: &[&[u8]], _init: bool, _ctx: &dyn Scope ) -> ApplyResult<Vec<u8, Global>>

source§

fn lookup_eval( &self, _id: &[u8], _abe: &[ABE], _scopes: &dyn Scope ) -> ApplyResult<Vec<u8, Global>>

source§

fn describe( &self, cb: &mut dyn FnMut(&str, &str, &mut dyn Iterator<Item = ScopeFuncInfo>, &mut dyn Iterator<Item = ScopeEvalInfo>) )

source§

fn encode( &self, _id: &[u8], _options: &[ABE], _bytes: &[u8] ) -> ApplyResult<String>

source§

impl<A> Scope for &Awhere A: Scope,

source§

fn lookup_eval( &self, id: &[u8], abe: &[ABE], scopes: &dyn Scope ) -> ApplyResult<Vec<u8, Global>>

source§

fn lookup_apply( &self, id: &[u8], args: &[&[u8]], init: bool, ctx: &dyn Scope ) -> ApplyResult<Vec<u8, Global>>

source§

fn describe( &self, cb: &mut dyn FnMut(&str, &str, &mut dyn Iterator<Item = ScopeFuncInfo>, &mut dyn Iterator<Item = ScopeEvalInfo>) )

source§

fn encode( &self, id: &[u8], options: &[ABE], bytes: &[u8] ) -> ApplyResult<String>

source§

impl<A> Scope for Option<A>where A: Scope,

source§

fn lookup_apply( &self, id: &[u8], inpt_and_args: &[&[u8]], init: bool, ctx: &dyn Scope ) -> ApplyResult<Vec<u8, Global>>

source§

fn describe( &self, cb: &mut dyn FnMut(&str, &str, &mut dyn Iterator<Item = ScopeFuncInfo>, &mut dyn Iterator<Item = ScopeEvalInfo>) )

source§

fn lookup_eval( &self, id: &[u8], abe: &[ABE], scopes: &dyn Scope ) -> ApplyResult<Vec<u8, Global>>

source§

fn encode( &self, id: &[u8], options: &[ABE], bytes: &[u8] ) -> ApplyResult<String>

source§

impl<A, B, C> Scope for (A, B, C)where A: Scope, B: Scope, C: Scope,

source§

fn lookup_apply( &self, id: &[u8], args: &[&[u8]], init: bool, ctx: &dyn Scope ) -> ApplyResult<Vec<u8, Global>>

source§

fn lookup_eval( &self, id: &[u8], abe: &[ABE], scope: &dyn Scope ) -> ApplyResult<Vec<u8, Global>>

source§

fn describe( &self, cb: &mut dyn FnMut(&str, &str, &mut dyn Iterator<Item = ScopeFuncInfo>, &mut dyn Iterator<Item = ScopeEvalInfo>) )

source§

fn encode( &self, id: &[u8], options: &[ABE], bytes: &[u8] ) -> ApplyResult<String>

source§

impl<A, B> Scope for (A, B)where A: Scope, B: Scope,

source§

fn lookup_apply( &self, id: &[u8], args: &[&[u8]], init: bool, ctx: &dyn Scope ) -> ApplyResult<Vec<u8, Global>>

source§

fn lookup_eval( &self, id: &[u8], abe: &[ABE], scope: &dyn Scope ) -> ApplyResult<Vec<u8, Global>>

source§

fn describe( &self, cb: &mut dyn FnMut(&str, &str, &mut dyn Iterator<Item = ScopeFuncInfo>, &mut dyn Iterator<Item = ScopeEvalInfo>) )

source§

fn encode( &self, id: &[u8], options: &[ABE], bytes: &[u8] ) -> ApplyResult<String>

Implementors§

source§

impl Scope for &dyn Scope

source§

impl<T> Scope for EScope<T>where T: EvalScopeImpl,