#[non_exhaustive]
pub enum Error {
    Closed {
        initiator: Location,
        source: &'static Location<'static>,
    },
    Transport {
        code: Code,
        frame_type: u64,
        reason: &'static str,
        initiator: Location,
        source: &'static Location<'static>,
    },
    Application {
        error: Error,
        initiator: Location,
        source: &'static Location<'static>,
    },
    StatelessReset {
        source: &'static Location<'static>,
    },
    IdleTimerExpired {
        source: &'static Location<'static>,
    },
    NoValidPath {
        source: &'static Location<'static>,
    },
    StreamIdExhausted {
        source: &'static Location<'static>,
    },
    MaxHandshakeDurationExceeded {
        max_handshake_duration: Duration,
        source: &'static Location<'static>,
    },
    ImmediateClose {
        reason: &'static str,
        source: &'static Location<'static>,
    },
    EndpointClosing {
        source: &'static Location<'static>,
    },
    Unspecified {
        source: &'static Location<'static>,
    },
}
Expand description

Errors that a connection can encounter.

Variants (Non-exhaustive)

This enum is marked as 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.

Closed

Fields

This variant is marked as non-exhaustive
Non-exhaustive enum variants could have additional fields added in future. Therefore, non-exhaustive enum variants cannot be constructed in external crates and cannot be matched against.
initiator: Location
source: &'static Location<'static>

The connection was closed without an error

Transport

Fields

This variant is marked as non-exhaustive
Non-exhaustive enum variants could have additional fields added in future. Therefore, non-exhaustive enum variants cannot be constructed in external crates and cannot be matched against.
code: Code
frame_type: u64
reason: &'static str
initiator: Location
source: &'static Location<'static>

The connection was closed on the transport level

This can occur either locally or by the peer. The argument contains the error code which the transport provided in order to close the connection.

Application

Fields

This variant is marked as non-exhaustive
Non-exhaustive enum variants could have additional fields added in future. Therefore, non-exhaustive enum variants cannot be constructed in external crates and cannot be matched against.
error: Error
initiator: Location
source: &'static Location<'static>

The connection was closed on the application level

This can occur either locally or by the peer. The argument contains the error code which the application/ supplied in order to close the connection.

StatelessReset

Fields

This variant is marked as non-exhaustive
Non-exhaustive enum variants could have additional fields added in future. Therefore, non-exhaustive enum variants cannot be constructed in external crates and cannot be matched against.
source: &'static Location<'static>

The connection was reset by a stateless reset from the peer

IdleTimerExpired

Fields

This variant is marked as non-exhaustive
Non-exhaustive enum variants could have additional fields added in future. Therefore, non-exhaustive enum variants cannot be constructed in external crates and cannot be matched against.
source: &'static Location<'static>

The connection was closed because the local connection’s idle timer expired

NoValidPath

Fields

This variant is marked as non-exhaustive
Non-exhaustive enum variants could have additional fields added in future. Therefore, non-exhaustive enum variants cannot be constructed in external crates and cannot be matched against.
source: &'static Location<'static>

The connection was closed because there are no valid paths

StreamIdExhausted

Fields

This variant is marked as non-exhaustive
Non-exhaustive enum variants could have additional fields added in future. Therefore, non-exhaustive enum variants cannot be constructed in external crates and cannot be matched against.
source: &'static Location<'static>

All Stream IDs for Streams on the given connection had been exhausted

MaxHandshakeDurationExceeded

Fields

This variant is marked as non-exhaustive
Non-exhaustive enum variants could have additional fields added in future. Therefore, non-exhaustive enum variants cannot be constructed in external crates and cannot be matched against.
max_handshake_duration: Duration
source: &'static Location<'static>

The handshake has taken longer to complete than the configured max handshake duration

ImmediateClose

Fields

This variant is marked as non-exhaustive
Non-exhaustive enum variants could have additional fields added in future. Therefore, non-exhaustive enum variants cannot be constructed in external crates and cannot be matched against.
reason: &'static str
source: &'static Location<'static>

The connection should be closed immediately without notifying the peer

EndpointClosing

Fields

This variant is marked as non-exhaustive
Non-exhaustive enum variants could have additional fields added in future. Therefore, non-exhaustive enum variants cannot be constructed in external crates and cannot be matched against.
source: &'static Location<'static>

The connection attempt was rejected because the endpoint is closing

Unspecified

Fields

This variant is marked as non-exhaustive
Non-exhaustive enum variants could have additional fields added in future. Therefore, non-exhaustive enum variants cannot be constructed in external crates and cannot be matched against.
source: &'static Location<'static>

The connection was closed due to an unspecified reason

Implementations

Returns the panic::Location for the error

Trait Implementations

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

Formats the value using the given formatter. Read more

Formats the value using the given formatter. Read more

Converts to this type from the input type.

Converts to this type from the input type.

Converts to this type from the input type.

Converts to this type from the input type.

Converts to this type from the input type.

This method tests for self and other values to be equal, and is used by ==. Read more

This method tests for !=.

Returns the associated Error, if any

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

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

The resulting type after obtaining ownership.

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

🔬 This is a nightly-only experimental API. (toowned_clone_into)

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

Converts the given value to a String. Read more

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.