pub struct Responder<M, T: Transport = <<M as Method>::Protocol as HasTransport>::Transport> { /* private fields */ }Expand description
A strongly typed Responder.
Implementations§
Source§impl<M, T: Transport> Responder<M, T>
impl<M, T: Transport> Responder<M, T>
Sourcepub fn from_untyped(responder: Responder<T>) -> Self
pub fn from_untyped(responder: Responder<T>) -> Self
Creates a new responder.
Sourcepub fn respond<R>(self, response: R) -> RespondFuture<T> ⓘwhere
M: TwoWayMethod + Respond<R>,
M::Response: Constrained<Constraint = ()> + Wire,
<M as Respond<R>>::Output: Encode<M::Response, T::SendBuffer>,
pub fn respond<R>(self, response: R) -> RespondFuture<T> ⓘwhere
M: TwoWayMethod + Respond<R>,
M::Response: Constrained<Constraint = ()> + Wire,
<M as Respond<R>>::Output: Encode<M::Response, T::SendBuffer>,
Responds to the client.
For methods which return a result, this method implicitly returns Ok
of the given response.
Sourcepub fn respond_err<R>(self, response: R) -> RespondFuture<T> ⓘwhere
M: TwoWayMethod + RespondErr<R>,
M::Response: Constrained<Constraint = ()> + Wire,
<M as RespondErr<R>>::Output: Encode<M::Response, T::SendBuffer>,
pub fn respond_err<R>(self, response: R) -> RespondFuture<T> ⓘwhere
M: TwoWayMethod + RespondErr<R>,
M::Response: Constrained<Constraint = ()> + Wire,
<M as RespondErr<R>>::Output: Encode<M::Response, T::SendBuffer>,
Responds Err to the client.
Sourcepub fn respond_with<R>(self, response: R) -> RespondFuture<T> ⓘwhere
M: TwoWayMethod,
M::Response: Constrained<Constraint = ()> + Wire,
R: Encode<M::Response, T::SendBuffer>,
pub fn respond_with<R>(self, response: R) -> RespondFuture<T> ⓘwhere
M: TwoWayMethod,
M::Response: Constrained<Constraint = ()> + Wire,
R: Encode<M::Response, T::SendBuffer>,
Responds to the client.
Auto Trait Implementations§
impl<M, T> Freeze for Responder<M, T>
impl<M, T = <<M as Method>::Protocol as HasTransport>::Transport> !RefUnwindSafe for Responder<M, T>
impl<M, T> Send for Responder<M, T>where
M: Send,
impl<M, T> Sync for Responder<M, T>where
M: Sync,
impl<M, T> Unpin for Responder<M, T>where
M: Unpin,
impl<M, T = <<M as Method>::Protocol as HasTransport>::Transport> !UnwindSafe for Responder<M, T>
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T, D> Encode<Ambiguous1, D> for Twhere
D: ResourceDialect,
impl<T, D> Encode<Ambiguous1, D> for Twhere
D: ResourceDialect,
Source§impl<T, D> Encode<Ambiguous2, D> for Twhere
D: ResourceDialect,
impl<T, D> Encode<Ambiguous2, D> for Twhere
D: ResourceDialect,
Source§impl<T> InstanceFromServiceTransport<T> for T
impl<T> InstanceFromServiceTransport<T> for T
Source§fn from_service_transport(handle: T) -> T
fn from_service_transport(handle: T) -> T
Converts the given service transport handle of type
T to Self