Expand description
A request made on a stream
Fields
tx: Option<Request<'a>>The tx options of the request
rx: Option<Request<'a>>The rx options of the request
Implementations
sourceimpl<'a> Request<'a>
impl<'a> Request<'a>
sourcepub fn send(&mut self, chunks: &'a mut [Bytes]) -> &mut Self
pub fn send(&mut self, chunks: &'a mut [Bytes]) -> &mut Self
Requests a slice of chunks to be sent on the tx stream
sourcepub fn finish(&mut self) -> &mut Self
pub fn finish(&mut self) -> &mut Self
Marks the tx stream as finished (e.g. no more data will be sent)
sourcepub fn receive(&mut self, chunks: &'a mut [Bytes]) -> &mut Self
pub fn receive(&mut self, chunks: &'a mut [Bytes]) -> &mut Self
Requests data on the rx stream to be received into the provided slice of chunks
sourcepub fn stop_sending(&mut self, error: Error) -> &mut Self
pub fn stop_sending(&mut self, error: Error) -> &mut Self
Requests the peer to stop sending data on the rx stream
sourcepub fn with_watermark(&mut self, low: usize, high: usize) -> &mut Self
pub fn with_watermark(&mut self, low: usize, high: usize) -> &mut Self
Sets the watermarks for the rx stream
sourcepub fn with_low_watermark(&mut self, low: usize) -> &mut Self
pub fn with_low_watermark(&mut self, low: usize) -> &mut Self
Sets the low watermark for the rx stream
If the watermark is set to 0, the caller will be notified as soon as there is data
available on the stream.
If the watermark is greater than 0, the caller will be notified as soon as there is at
least low bytes available to be read. Note that the stream may be woken earlier.
sourcepub fn with_high_watermark(&mut self, high: usize) -> &mut Self
pub fn with_high_watermark(&mut self, high: usize) -> &mut Self
Sets the high watermark for the rx stream
The stream ensures that all the received data will not exceed the watermark amount. This
can be useful for receiving at most n bytes.
pub fn detach_tx(&mut self) -> &mut Self
pub fn detach_rx(&mut self) -> &mut Self
Trait Implementations
Auto Trait Implementations
impl<'a> RefUnwindSafe for Request<'a>
impl<'a> Send for Request<'a>
impl<'a> Sync for Request<'a>
impl<'a> Unpin for Request<'a>
impl<'a> !UnwindSafe for Request<'a>
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more