pub struct Null { /* private fields */ }Available on crate features
test-util only.Expand description
Implementations§
Source§impl Null
impl Null
Sourcepub fn builder() -> NullBuilder
pub fn builder() -> NullBuilder
Starts building a new NullStream.
Sourcepub async fn read_at_most_into(
&mut self,
_len: usize,
into: BytesBuf,
) -> Result<(usize, BytesBuf), Infallible>
pub async fn read_at_most_into( &mut self, _len: usize, into: BytesBuf, ) -> Result<(usize, BytesBuf), Infallible>
Sourcepub async fn read_more_into(
&mut self,
into: BytesBuf,
) -> Result<(usize, BytesBuf), Infallible>
pub async fn read_more_into( &mut self, into: BytesBuf, ) -> Result<(usize, BytesBuf), Infallible>
Sourcepub async fn read_any(&mut self) -> Result<BytesBuf, Infallible>
pub async fn read_any(&mut self) -> Result<BytesBuf, Infallible>
Sourcepub fn memory(&self) -> impl MemoryShared
pub fn memory(&self) -> impl MemoryShared
Returns the memory provider that was configured in the builder.
Sourcepub fn reserve(&self, min_bytes: usize) -> BytesBuf
pub fn reserve(&self, min_bytes: usize) -> BytesBuf
Reserves at least min_bytes bytes of memory capacity.
Returns an empty BytesBuf that can be used to fill the reserved memory with data.
The memory provider may provide more memory than requested.
The memory reservation request will always be fulfilled, obtaining more memory from the operating system if necessary.
§Zero-sized reservations
Reserving zero bytes of memory is a valid operation and will return a BytesBuf
with zero or more bytes of capacity.
§Panics
May panic if the operating system runs out of memory.
Trait Implementations§
Source§impl HasMemory for Null
impl HasMemory for Null
Source§fn memory(&self) -> impl MemoryShared
fn memory(&self) -> impl MemoryShared
Returns a sharing-compatible memory provider. Read more
Source§impl Read for Null
impl Read for Null
Source§type Error = Infallible
type Error = Infallible
Type used to signal errors by the implementation of this trait.
Source§async fn read_at_most_into(
&mut self,
len: usize,
into: BytesBuf,
) -> Result<(usize, BytesBuf), Infallible>
async fn read_at_most_into( &mut self, len: usize, into: BytesBuf, ) -> Result<(usize, BytesBuf), Infallible>
Reads at most
len bytes into the provided buffer. Read moreSource§async fn read_more_into(
&mut self,
into: BytesBuf,
) -> Result<(usize, BytesBuf), Infallible>
async fn read_more_into( &mut self, into: BytesBuf, ) -> Result<(usize, BytesBuf), Infallible>
Reads an unspecified number of bytes into the provided buffer. Read more
Auto Trait Implementations§
impl Freeze for Null
impl !RefUnwindSafe for Null
impl Send for Null
impl Sync for Null
impl Unpin for Null
impl !UnwindSafe for Null
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> ReadExt for Twhere
T: Read,
impl<T> ReadExt for Twhere
T: Read,
Source§async fn read_at_most(&mut self, len: usize) -> Result<BytesView, Error>
async fn read_at_most(&mut self, len: usize) -> Result<BytesView, Error>
Reads at most
len bytes into a new buffer. Read moreSource§async fn read_exactly(&mut self, len: usize) -> Result<BytesView, Error>
async fn read_exactly(&mut self, len: usize) -> Result<BytesView, Error>
Reads exactly
len bytes into a new buffer. Read moreSource§async fn read_at_most_while<F>(
&mut self,
len: usize,
inspect_fn: F,
) -> Result<(BytesView, BytesBuf), Error>
async fn read_at_most_while<F>( &mut self, len: usize, inspect_fn: F, ) -> Result<(BytesView, BytesBuf), Error>
Conditionally reads at most
len bytes into a new buffer. Read moreSource§async fn read_at_most_into_while<F>(
&mut self,
len: usize,
into: BytesBuf,
inspect_fn: F,
) -> Result<(BytesView, BytesBuf), Error>
async fn read_at_most_into_while<F>( &mut self, len: usize, into: BytesBuf, inspect_fn: F, ) -> Result<(BytesView, BytesBuf), Error>
Conditionally reads at most
len bytes into the provided buffer. Read moreSource§fn into_futures_stream(self) -> Pin<Box<ReadAsFuturesStream<T>>>
fn into_futures_stream(self) -> Pin<Box<ReadAsFuturesStream<T>>>
Available on crate feature
futures-stream only.