Struct Empty

Source
pub struct Empty<Item, Error>(/* private fields */);
Expand description

A BufStream that contains no data.

Implementations§

Source§

impl<Item, Error> Empty<Item, Error>

Source

pub fn new() -> Self

Create a new Empty instance.

Trait Implementations§

Source§

impl<Item, Error> BufStream for Empty<Item, Error>
where Item: Buf,

Source§

type Item = Item

Values yielded by the BufStream.
Source§

type Error = Error

The error type this BufStream might generate.
Source§

fn poll(&mut self) -> Poll<Option<Self::Item>, Self::Error>

Attempt to pull out the next buffer of this stream, registering the current task for wakeup if the value is not yet available, and returning None if the stream is exhausted. Read more
Source§

fn size_hint(&self) -> SizeHint

Returns the bounds on the remaining length of the iterator. Read more
Source§

fn chain<T>(self, other: T) -> Chain<Self, T>
where Self: Sized, T: BufStream<Error = Self::Error>,

Takes two buf streams and creates a new buf stream over both in sequence. Read more
Source§

fn collect<T>(self) -> Collect<Self, T>
where Self: Sized, T: FromBufStream,

Consumes all data from self, storing it in byte storage of type T.
Source§

impl<Item: Clone, Error: Clone> Clone for Empty<Item, Error>

Source§

fn clone(&self) -> Empty<Item, Error>

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl<Item: Debug, Error: Debug> Debug for Empty<Item, Error>

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<Item, Error> Default for Empty<Item, Error>

Source§

fn default() -> Self

Returns the “default value” for a type. Read more
Source§

impl<Item: Copy, Error: Copy> Copy for Empty<Item, Error>

Auto Trait Implementations§

§

impl<Item, Error> Freeze for Empty<Item, Error>

§

impl<Item, Error> RefUnwindSafe for Empty<Item, Error>
where Item: RefUnwindSafe, Error: RefUnwindSafe,

§

impl<Item, Error> Send for Empty<Item, Error>
where Item: Send, Error: Send,

§

impl<Item, Error> Sync for Empty<Item, Error>
where Item: Sync, Error: Sync,

§

impl<Item, Error> Unpin for Empty<Item, Error>
where Item: Unpin, Error: Unpin,

§

impl<Item, Error> UnwindSafe for Empty<Item, Error>
where Item: UnwindSafe, Error: UnwindSafe,

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> IntoEither for T

Source§

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 more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

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
Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.