WithExtra

Struct WithExtra 

Source
pub struct WithExtra<T, Ex> { /* private fields */ }
Expand description

Future/Stream/Sink with extra data attached.

Implementations§

Source§

impl<T, Ex> WithExtra<T, Ex>

Source

pub const fn new(inner: T, extra: Ex) -> Self

Attach extra data to a value.

Source

pub fn into_inner(self) -> (T, Ex)

Unwrap into parts.

Source

pub fn as_pin_mut(self: Pin<&mut Self>) -> Pin<&mut T>

Get a pinned mutable reference to the inner value.

Trait Implementations§

Source§

impl<T, Ex> AsMut<T> for WithExtra<T, Ex>

Source§

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

Converts this type into a mutable reference of the (usually inferred) input type.
Source§

impl<T, Ex> AsRef<T> for WithExtra<T, Ex>

Source§

fn as_ref(&self) -> &T

Converts this type into a shared reference of the (usually inferred) input type.
Source§

impl<T: Clone, Ex: Clone> Clone for WithExtra<T, Ex>

Source§

fn clone(&self) -> WithExtra<T, Ex>

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<T: Debug, Ex: Debug> Debug for WithExtra<T, Ex>

Source§

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

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

impl<T: Default, Ex: Default> Default for WithExtra<T, Ex>

Source§

fn default() -> WithExtra<T, Ex>

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

impl<Route, Msg, T: FlushRoute<Route, Msg>, Ex> FlushRoute<Route, Msg> for WithExtra<T, Ex>

Available on crate feature route-sink only.
Source§

fn poll_flush_route( self: Pin<&mut Self>, route: &Route, cx: &mut Context<'_>, ) -> Poll<Result<(), Self::Error>>

Source§

fn poll_close_route( self: Pin<&mut Self>, route: &Route, cx: &mut Context<'_>, ) -> Poll<Result<(), Self::Error>>

Source§

impl<T, Ex> From<(T, Ex)> for WithExtra<T, Ex>

Source§

fn from((inner, extra): (T, Ex)) -> Self

Converts to this type from the input type.
Source§

impl<T, Ex: Default> From<T> for WithExtra<T, Ex>

Source§

fn from(inner: T) -> Self

Converts to this type from the input type.
Source§

impl<T, Ex> From<WithExtra<T, Ex>> for (T, Ex)

Source§

fn from(value: WithExtra<T, Ex>) -> Self

Converts to this type from the input type.
Source§

impl<T: FusedFuture, Ex> FusedFuture for WithExtra<T, Ex>

Available on crate feature futures-core only.
Source§

fn is_terminated(&self) -> bool

Returns true if the underlying future should no longer be polled.
Source§

impl<T: FusedStream, Ex> FusedStream for WithExtra<T, Ex>

Available on crate feature futures-core only.
Source§

fn is_terminated(&self) -> bool

Returns true if the stream should no longer be polled.
Source§

impl<T: Future, Ex> Future for WithExtra<T, Ex>

Available on crate feature futures-core only.
Source§

type Output = <T as Future>::Output

The type of value produced on completion.
Source§

fn poll(self: Pin<&mut Self>, cx: &mut Context<'_>) -> Poll<Self::Output>

Attempts to resolve the future to a final value, registering the current task for wakeup if the value is not yet available. Read more
Source§

impl<T: Hash, Ex: Hash> Hash for WithExtra<T, Ex>

Source§

fn hash<__H: Hasher>(&self, state: &mut __H)

Feeds this value into the given Hasher. Read more
1.3.0 · Source§

fn hash_slice<H>(data: &[Self], state: &mut H)
where H: Hasher, Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
Source§

impl<T: PartialEq, Ex: PartialEq> PartialEq for WithExtra<T, Ex>

Source§

fn eq(&self, other: &WithExtra<T, Ex>) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl<Route, Msg, T: ReadyRoute<Route, Msg>, Ex> ReadyRoute<Route, Msg> for WithExtra<T, Ex>

Available on crate feature route-sink only.
Source§

fn poll_ready_route( self: Pin<&mut Self>, route: &Route, cx: &mut Context<'_>, ) -> Poll<Result<(), Self::Error>>

Source§

impl<Route, Msg, T: ReadySome<Route, Msg>, Ex> ReadySome<Route, Msg> for WithExtra<T, Ex>

Available on crate feature route-sink only.
Source§

fn poll_ready_some( self: Pin<&mut Self>, cx: &mut Context<'_>, ) -> Poll<Result<Route, Self::Error>>

Source§

impl<Item, T: Sink<Item>, Ex> Sink<Item> for WithExtra<T, Ex>

Available on crate feature futures-sink only.
Source§

type Error = <T as Sink<Item>>::Error

The type of value produced by the sink when an error occurs.
Source§

fn poll_ready( self: Pin<&mut Self>, cx: &mut Context<'_>, ) -> Poll<Result<(), Self::Error>>

Attempts to prepare the Sink to receive a value. Read more
Source§

fn start_send(self: Pin<&mut Self>, item: Item) -> Result<(), Self::Error>

Begin the process of sending a value to the sink. Each call to this function must be preceded by a successful call to poll_ready which returned Poll::Ready(Ok(())). Read more
Source§

fn poll_flush( self: Pin<&mut Self>, cx: &mut Context<'_>, ) -> Poll<Result<(), Self::Error>>

Flush any remaining output from this sink. Read more
Source§

fn poll_close( self: Pin<&mut Self>, cx: &mut Context<'_>, ) -> Poll<Result<(), Self::Error>>

Flush any remaining output and close this sink, if necessary. Read more
Source§

impl<T: Stream, Ex> Stream for WithExtra<T, Ex>

Available on crate feature futures-core only.
Source§

type Item = <T as Stream>::Item

Values yielded by the stream.
Source§

fn poll_next( self: Pin<&mut Self>, cx: &mut Context<'_>, ) -> Poll<Option<Self::Item>>

Attempt to pull out the next value 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) -> (usize, Option<usize>)

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

impl<T: Copy, Ex: Copy> Copy for WithExtra<T, Ex>

Source§

impl<T: Eq, Ex: Eq> Eq for WithExtra<T, Ex>

Source§

impl<T, Ex> StructuralPartialEq for WithExtra<T, Ex>

Source§

impl<'pin, T, Ex> Unpin for WithExtra<T, Ex>
where PinnedFieldsOf<__WithExtra<'pin, T, Ex>>: Unpin,

Auto Trait Implementations§

§

impl<T, Ex> Freeze for WithExtra<T, Ex>
where T: Freeze, Ex: Freeze,

§

impl<T, Ex> RefUnwindSafe for WithExtra<T, Ex>

§

impl<T, Ex> Send for WithExtra<T, Ex>
where T: Send, Ex: Send,

§

impl<T, Ex> Sync for WithExtra<T, Ex>
where T: Sync, Ex: Sync,

§

impl<T, Ex> UnwindSafe for WithExtra<T, Ex>
where T: UnwindSafe, Ex: 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<!> for T

Source§

fn from(t: !) -> T

Converts to this type from the input type.
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<F> IntoFuture for F
where F: Future,

Source§

type Output = <F as Future>::Output

The output that the future will produce on completion.
Source§

type IntoFuture = F

Which kind of future are we turning this into?
Source§

fn into_future(self) -> <F as IntoFuture>::IntoFuture

Creates a future from a value. Read more
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<F, T, E> TryFuture for F
where F: Future<Output = Result<T, E>> + ?Sized,

Source§

type Ok = T

The type of successful values yielded by this future
Source§

type Error = E

The type of failures yielded by this future
Source§

fn try_poll( self: Pin<&mut F>, cx: &mut Context<'_>, ) -> Poll<<F as Future>::Output>

Poll this TryFuture as if it were a Future. Read more
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.
Source§

impl<S, T, E> TryStream for S
where S: Stream<Item = Result<T, E>> + ?Sized,

Source§

type Ok = T

The type of successful values yielded by this future
Source§

type Error = E

The type of failures yielded by this future
Source§

fn try_poll_next( self: Pin<&mut S>, cx: &mut Context<'_>, ) -> Poll<Option<Result<<S as TryStream>::Ok, <S as TryStream>::Error>>>

Poll this TryStream as if it were a Stream. Read more