Trait iron_json::Plugin []

pub trait Plugin {
    fn get<P>(
        &mut self
    ) -> Result<<P as Key>::Value, <P as Plugin<Self>>::Error>
    where
        P: Plugin<Self>,
        Self: Extensible,
        <P as Key>::Value: Clone,
        <P as Key>::Value: Any
, { ... } fn get_ref<P>(
        &mut self
    ) -> Result<&<P as Key>::Value, <P as Plugin<Self>>::Error>
    where
        P: Plugin<Self>,
        Self: Extensible,
        <P as Key>::Value: Any
, { ... } fn get_mut<P>(
        &mut self
    ) -> Result<&mut <P as Key>::Value, <P as Plugin<Self>>::Error>
    where
        P: Plugin<Self>,
        Self: Extensible,
        <P as Key>::Value: Any
, { ... } fn compute<P>(
        &mut self
    ) -> Result<<P as Key>::Value, <P as Plugin<Self>>::Error>
    where
        P: Plugin<Self>
, { ... } }

An interface for plugins that cache values between calls.

R is the type of the plugin's return value, which must be cloneable.

Provided Methods

Return a copy of the plugin's produced value.

The plugin will be created if it doesn't exist already. If plugin creation fails, an error is returned.

P is the plugin type.

Return a reference to the plugin's produced value.

The plugin will be created if it doesn't exist already. If plugin creation fails an error is returned.

P is the plugin type.

Return a mutable reference to the plugin's produced value.

The plugin will be created if it doesn't exist already. If plugin creation fail an error is returned.

P is the plugin type.

Create and evaluate a once-off instance of a plugin.

Implementors