[][src]Struct kayrx::jrpc::raw::server::TypedResponder

pub struct TypedResponder<'a, R, I, T> { /* fields omitted */ }

Allows responding to a server request in a more elegant and strongly-typed fashion.

Methods

impl<'a, R, I, T> TypedResponder<'a, R, I, T> where
    R: TransportServer<RequestId = I>,
    I: Clone + PartialEq + Eq + Hash + Send + Sync,
    T: Serialize
[src]

pub async fn ok(self, response: impl Into<T>)[src]

Returns a successful response.

pub async fn err(self, err: Error)[src]

Returns an erroneous response.

pub async fn respond(self, response: Result<impl Into<T>, Error>)[src]

Returns a response.

Trait Implementations

impl<'a, R, I, T> From<RawServerRequest<'a, R, I>> for TypedResponder<'a, R, I, T>[src]

Auto Trait Implementations

impl<'a, R, I, T> RefUnwindSafe for TypedResponder<'a, R, I, T> where
    I: RefUnwindSafe,
    R: RefUnwindSafe,
    T: RefUnwindSafe

impl<'a, R, I, T> Send for TypedResponder<'a, R, I, T> where
    I: Send,
    R: Send,
    T: Send

impl<'a, R, I, T> Sync for TypedResponder<'a, R, I, T> where
    I: Sync,
    R: Sync,
    T: Sync

impl<'a, R, I, T> Unpin for TypedResponder<'a, R, I, T> where
    T: Unpin

impl<'a, R, I, T> !UnwindSafe for TypedResponder<'a, R, I, T>

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.

impl<V, T> VZip<V> for T where
    V: MultiLane<T>,