[][src]Enum mesher::fail::MesherFail

#[non_exhaustive]pub enum MesherFail {
    NoKeys,
    InvalidPacket,
    NoReplyBlock,
    InvalidURL(String),
    UnregisteredScheme(String),
    SetupFailure(String),
    SendFailure(String),
    ListenFailure(String),
    ReceiveFailure(String),
    Other(Box<dyn Error>),
}

Every possible way a Mesher can fail to do something.

Generally split into two categories, mesher and transport errors. The transports can error out in any stage of their lifetime except dropping: setup, sending, listening, or receiving.

This enum is #[non_exhaustive] because future releases are all but guaranteed to add more specific, and therefore more helpful, error states.

Variants (Non-exhaustive)

Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.
NoKeys

The mesher needed at least one secret key but none were available.

This is only triggerd when keys are actually used, not during initialization. Meshers can generally be safely created without keys, then have them added, so long as it doesn't try to receive messages or send signed ones.

InvalidPacket

A mesher received a packet in a format that couldn't be parsed into a packet.

Note that packets with no chunks encrypted for the receiving mesher will not be treated as an error. They will be no-ops. This error means that the packet itself had an invalid structure.

NoReplyBlock

You tried to reply to a message that doesn't have a reply block attached.

InvalidURL(String)

The URL passed as the path to transport a packet along is invalid.

UnregisteredScheme(String)

The URL's scheme hasn't been registered with the mesher, so it can't know what transport to use to move the packet.

SetupFailure(String)

The transport being asked to listen on a path wasn't able to.

SendFailure(String)

The transport being asked to send data along a path wasn't able to.

This can trigger during calls to Mesher::receive, since it will send packets as requested while parsing them.

ListenFailure(String)

The transport being asked to listen along a path wasn't able to.

ReceiveFailure(String)

The transport being asked to fetch all received messages wasn't able to.

Other(Box<dyn Error>)

Some other error happened. Ideally, this would never be returned, but it's left as an option just in case, or for debugging.

Trait Implementations

impl Debug for MesherFail[src]

Auto Trait Implementations

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, 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.

impl<V, T> VZip<V> for T where
    V: MultiLane<T>,