Struct MethodCompletable

Source
pub struct MethodCompletable<RET: Serialize, RET_ERROR: Serialize> { /* private fields */ }
Expand description

Helper type that wraps a ResponseCompletable, and binds the possible completion to a result MethodResult<RET, RET_ERROR>

Implementations§

Source§

impl<RET: Serialize, RET_ERROR: Serialize> MethodCompletable<RET, RET_ERROR>

Source

pub fn new( completable: ResponseCompletable, ) -> MethodCompletable<RET, RET_ERROR>

Source

pub fn parse_params_and_complete_with<PARAMS, METHOD>( self, params: RequestParams, method_fn: METHOD, )
where PARAMS: Deserialize, RET: Serialize, RET_ERROR: Serialize, METHOD: FnOnce(PARAMS, Self),

Source

pub fn complete(self, result: MethodResult<RET, RET_ERROR>)

Auto Trait Implementations§

§

impl<RET, RET_ERROR> Freeze for MethodCompletable<RET, RET_ERROR>

§

impl<RET, RET_ERROR> !RefUnwindSafe for MethodCompletable<RET, RET_ERROR>

§

impl<RET, RET_ERROR> Send for MethodCompletable<RET, RET_ERROR>
where RET: Send, RET_ERROR: Send,

§

impl<RET, RET_ERROR> !Sync for MethodCompletable<RET, RET_ERROR>

§

impl<RET, RET_ERROR> Unpin for MethodCompletable<RET, RET_ERROR>
where RET: Unpin, RET_ERROR: Unpin,

§

impl<RET, RET_ERROR> !UnwindSafe for MethodCompletable<RET, RET_ERROR>

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.