[][src]Enum qp2p::Error

#[non_exhaustive]pub enum Error {
    BootstrapFailure,
    EmptyBootstrapNodesList,
    InvalidPath(String),
    UserHomeDir,
    Io(Error),
    Connect(ConnectError),
    Connection(ConnectionError),
    Endpoint(EndpointError),
    CertificateParse,
    CertificatePkParse,
    NoEchoServerEndpointDefined,
    NoEchoServiceResponse,
    EchoServiceFailure(String),
    TLS(TLSError),
    Serialisation(Error),
    Base64Decode(DecodeError),
    Configuration(String),
    InvalidMsgFlag(u8),
    StreamWrite(WriteError),
    StreamRead(ReadExactError),
    IgdAddPort(AddAnyPortError),
    IgdRenewPort(AddPortError),
    IgdSearch(SearchError),
    IgdNotSupported,
    CertificateGen(RcgenError),
    EmptyResponse,
    UnexpectedMessageType(WireMsg),
    MaxLengthExceeded(usize),
}

Error types returned by the qp2p public API.

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

Error occurred when attempting to connect to any of the peers provided as a list of contacts.

EmptyBootstrapNodesList

No peers/contects found in the bootstrap nodes list.

InvalidPath(String)

The path provided is not valid for the operation.

UserHomeDir

The user's home directory couldn't be determined.

Io(Error)

I/O failure when attempting to access a local resource.

Connect(ConnectError)

Failure encountered when establishing a connection with another peer.

Connection(ConnectionError)

An existing connection with another peer has been lost.

Endpoint(EndpointError)

Failed to create a new endpoint.

CertificateParse

Certificate for secure communication couldn't be parsed.

CertificatePkParse

The certificate's private key for secure communication couldn't be parsed.

NoEchoServerEndpointDefined

The contacts list was found empty when attempting to contact peers for the echo service.

NoEchoServiceResponse

Timeout occurred when awaiting for a response from any of the peers contacted for the echo service.

EchoServiceFailure(String)

Failure occurred when sending an echo request.

TLS error

Serialisation(Error)

Serialisation error, which can happen on different type of data.

Base64Decode(DecodeError)

Failed to decode a base64-encoded string.

Configuration(String)

An error occurred which could be resolved by changing some config value.

InvalidMsgFlag(u8)

The message type flag decoded in an incoming stream is invalid/unsupported.

StreamWrite(WriteError)

Error occurred when trying to write on a currently opened message stream.

StreamRead(ReadExactError)

The expected amount of message bytes couldn't be read from the stream.

IgdAddPort(AddAnyPortError)

Failure when trying to map a new port using IGD for automatic port forwarding.

IgdRenewPort(AddPortError)

Failure when trying to renew leasing of a port mapped using IGD.

IgdSearch(SearchError)

IGD gateway deice was not found.

IgdNotSupported

IGD is not supported on IPv6

CertificateGen(RcgenError)

An error was encountered when trying to either generate or serialise a self-signed certificate.

EmptyResponse

Response message received contains an empty payload.

UnexpectedMessageType(WireMsg)

The type of message received is not the expected one.

MaxLengthExceeded(usize)

The message exceeds the maximum message length allowed.

Trait Implementations

impl Debug for Error[src]

impl Display for Error[src]

impl Error for Error[src]

impl From<AddAnyPortError> for Error[src]

impl From<AddPortError> for Error[src]

impl From<Box<ErrorKind, Global>> for Error[src]

impl From<ConnectError> for Error[src]

impl From<ConnectionError> for Error[src]

impl From<DecodeError> for Error[src]

impl From<EndpointError> for Error[src]

impl From<Error> for Error[src]

impl From<RcgenError> for Error[src]

impl From<ReadExactError> for Error[src]

impl From<SearchError> for Error[src]

impl From<TLSError> for Error[src]

impl From<WriteError> for Error[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> Instrument for T[src]

impl<T> Instrument for T[src]

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

impl<T> ToString for T where
    T: Display + ?Sized
[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>,