Trait Callback

Source
pub trait Callback {
    type Res;
    type Cfg;

    // Required method
    fn call<T: ParserTrait>(cfg: Self::Cfg, parser: &T) -> Self::Res;
}
Expand description

A trait for callback functions.

Allows to call a private library function, getting as result its output value.

Required Associated Types§

Source

type Res

The output type returned by the callee

Source

type Cfg

The input type used by the caller to pass the arguments to the callee

Required Methods§

Source

fn call<T: ParserTrait>(cfg: Self::Cfg, parser: &T) -> Self::Res

Calls a function inside the library and returns its value

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.

Implementors§