[][src]Struct fasteval::evalns::CachedCallbackNamespace

pub struct CachedCallbackNamespace<'a> { /* fields omitted */ }

CachedCallbackNamespace is useful when your variable/function lookups are expensive.

Each variable+args combo will only be looked up once, and then it will be cached and re-used for subsequent lookups.

See module-level documentation for example.

Methods

impl<'a> CachedCallbackNamespace<'a>[src]

pub fn new<F>(cb: F) -> Self where
    F: FnMut(&str, Vec<f64>) -> Option<f64> + 'a, 
[src]

Trait Implementations

impl<'_> Cached for CachedCallbackNamespace<'_>[src]

impl<'_> EvalNamespace for CachedCallbackNamespace<'_>[src]

fn lookup(
    &mut self,
    name: &str,
    args: Vec<f64>,
    keybuf: &mut String
) -> Option<f64>
[src]

Returns a cached value if possible, otherwise delegates to the callback function.

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<F> EvalNamespace for F where
    F: FnMut(&str, Vec<f64>) -> Option<f64>, 
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.