Skip to main content

Extension

Trait Extension 

Source
pub trait Extension:
    Send
    + Sync
    + 'static {
    // Required method
    fn call(&self, ctx: &CallContext, payload: Value) -> Result<Value>;
}
Expand description

An extension: what answers the calls made to one name.

call runs on the blocking pool, so it may block; closures and functions of the same signature are extensions too.

Required Methods§

Source

fn call(&self, ctx: &CallContext, payload: Value) -> Result<Value>

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§

Source§

impl<F> Extension for F
where F: Fn(&CallContext, Value) -> Result<Value> + Send + Sync + 'static,