Skip to main content

Mer

Struct Mer 

Source
pub struct Mer<B, F>
where B: Backend, F: Frontend<Backend = B>,
{ /* private fields */ }
Expand description

RPC client and/or server type.

Container for Backend, Frontend and Middlewares.

Implementations§

Source§

impl<B: Backend, F: Frontend<Backend = B>> Mer<B, F>

Returns a new MerBuilder

Source

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

Source§

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

Source

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

Allows accessing the Frontend.

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

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

Allows accessing the Backend.

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

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,

Allows accessing the Middlewares.

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

Auto Trait Implementations§

§

impl<B, F> Freeze for Mer<B, F>

§

impl<B, F> RefUnwindSafe for Mer<B, F>

§

impl<B, F> Send for Mer<B, F>

§

impl<B, F> Sync for Mer<B, F>

§

impl<B, F> Unpin for Mer<B, F>

§

impl<B, F> UnsafeUnpin for Mer<B, F>

§

impl<B, F> UnwindSafe for Mer<B, F>

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

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

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.