[][src]Struct glommio::channels::local_channel::ChannelError

pub struct ChannelError<T> {
    pub item: T,
    // some fields omitted
}

This is the error that is returned from channel operations if something goes wrong.

It encapsulates an ErrorKind, which will be different for each kind of error and also makes the item sent through the channel available through the public attribute item.

You can convert between this and io::Error (losing information on item) so the ? constructs around io::Error should all work. Another possible way of doing this is returning an io::Error and encapsulating item on its inner field. However that adds Send and Sync requirements plus an allocation to the inner field (or to a helper struct around the inner field) that we'd like to avoid.

Fields

item: T

The ChannelError encapsulates the item we originally tried to send into the channel in case you need to do something with it upon failure.

Trait Implementations

impl<T: Debug> Debug for ChannelError<T>[src]

impl<T: Debug> From<ChannelError<T>> for Error[src]

Auto Trait Implementations

impl<T> RefUnwindSafe for ChannelError<T> where
    T: RefUnwindSafe

impl<T> Send for ChannelError<T> where
    T: Send

impl<T> Sync for ChannelError<T> where
    T: Sync

impl<T> Unpin for ChannelError<T> where
    T: Unpin

impl<T> UnwindSafe for ChannelError<T> where
    T: UnwindSafe

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> Same<T> for T[src]

type Output = T

Should always be Self

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

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

The type returned in the event of a conversion error.