[][src]Trait exonum_api::ApiBackend

pub trait ApiBackend: Sized {
    type Handler;
    type Backend;
    fn raw_handler(&mut self, handler: Self::Handler) -> &mut Self;
fn wire(&self, output: Self::Backend) -> Self::Backend; fn endpoint<Q, I, R, F, E>(&mut self, name: &str, endpoint: E) -> &mut Self
    where
        Q: DeserializeOwned + 'static,
        I: Serialize + 'static,
        F: Fn(Q) -> R + 'static + Clone,
        E: Into<With<Q, I, R, F>>,
        Self::Handler: From<NamedWith<Q, I, R, F>>
, { ... }
fn endpoint_mut<Q, I, R, F, E>(
        &mut self,
        name: &str,
        endpoint: E
    ) -> &mut Self
    where
        Q: DeserializeOwned + 'static,
        I: Serialize + 'static,
        F: Fn(Q) -> R + 'static + Clone,
        E: Into<With<Q, I, R, F>>,
        Self::Handler: From<NamedWith<Q, I, R, F>>
, { ... } }

This trait is used to implement an API backend for Exonum.

Associated Types

type Handler

Concrete endpoint handler in the backend.

type Backend

Concrete backend API builder.

Loading content...

Required methods

fn raw_handler(&mut self, handler: Self::Handler) -> &mut Self

Add the raw endpoint handler for the given backend.

fn wire(&self, output: Self::Backend) -> Self::Backend

Bind API handlers to the given backend.

Loading content...

Provided methods

fn endpoint<Q, I, R, F, E>(&mut self, name: &str, endpoint: E) -> &mut Self where
    Q: DeserializeOwned + 'static,
    I: Serialize + 'static,
    F: Fn(Q) -> R + 'static + Clone,
    E: Into<With<Q, I, R, F>>,
    Self::Handler: From<NamedWith<Q, I, R, F>>, 

Adds the given endpoint handler to the backend.

fn endpoint_mut<Q, I, R, F, E>(&mut self, name: &str, endpoint: E) -> &mut Self where
    Q: DeserializeOwned + 'static,
    I: Serialize + 'static,
    F: Fn(Q) -> R + 'static + Clone,
    E: Into<With<Q, I, R, F>>,
    Self::Handler: From<NamedWith<Q, I, R, F>>, 

Adds the given mutable endpoint handler to the backend.

Loading content...

Implementors

impl ApiBackend for ApiBuilder[src]

type Handler = RequestHandler

type Backend = Scope

Loading content...