pub struct OutgoingResponse {
pub result: Result<Vec<u8>, ()>,
pub sent_feedback: Option<Sender<()>>,
}
Expand description
Response for an incoming request to be send by a request protocol handler.
Fields§
§result: Result<Vec<u8>, ()>
The payload of the response.
Err(())
if none is available e.g. due an error while handling the request.
sent_feedback: Option<Sender<()>>
If provided, the oneshot::Sender
will be notified when the request has been sent to the
peer.
Note: Operating systems typically maintain a buffer of a few dozen kilobytes of outgoing data for each TCP socket, and it is not possible for a user application to inspect this buffer. This channel here is not actually notified when the response has been fully sent out, but rather when it has fully been written to the buffer managed by the operating system.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for OutgoingResponse
impl !RefUnwindSafe for OutgoingResponse
impl Send for OutgoingResponse
impl Sync for OutgoingResponse
impl Unpin for OutgoingResponse
impl !UnwindSafe for OutgoingResponse
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
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
source§impl<T> IntoEither for T
impl<T> IntoEither for T
source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moresource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more