Struct merfolk::Mer[][src]

pub struct Mer<B, F> where
    B: Backend,
    F: Frontend<Backend = B>, 
{ /* fields omitted */ }

RPC client and/or server type.

Container for Backend, Frontend and Middlewares.

Implementations

impl<B: Backend, F: Frontend<Backend = B>> Mer<B, F>[src]

Returns a new MerBuilder

pub fn builder() -> MerBuilder<B, F>[src]

impl<B: Backend + 'static, F: Frontend<Backend = B>> Mer<B, F>[src]

pub fn frontend<T, R>(&self, access: T) -> Result<R, Error> where
    T: Fn(&mut F) -> R, 
[src]

Allows accessing the Frontend.

let result: i32 = merfolk.frontend(|f| f.call("add", &(1, 2)).unwrap()).unwrap();

pub fn backend<T, R>(&self, access: T) -> Result<R, Error> where
    T: Fn(&mut B) -> R, 
[src]

Allows accessing the Backend.

merfolk.backend(|b| b.stop().unwrap()).unwrap();

pub fn middlewares<M, T, R>(&self, index: usize, access: T) -> Result<R, Error> where
    M: Middleware<Backend = B> + 'static,
    T: Fn(&mut M) -> R, 
[src]

Allows accessing the Middlewares.

merfolk.middlewares(0, |_m: &mut Authentication<Http>| {}).unwrap();

Auto Trait Implementations

impl<B, F> RefUnwindSafe for Mer<B, F>[src]

impl<B, F> Send for Mer<B, F>[src]

impl<B, F> Sync for Mer<B, F>[src]

impl<B, F> Unpin for Mer<B, F>[src]

impl<B, F> UnwindSafe for Mer<B, F>[src]

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<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.