Enum qp2p::Error[][src]

#[non_exhaustive]
pub enum Error {
Show variants 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), IncorrectPublicAddress, MissingConnection, UnexpectedError(String), UnspecifiedLocalIp, UnresolvedPublicIp,
}
Expand description

Error types returned by the qp2p public API.

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

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

EmptyBootstrapNodesList

No peers/contacts 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.

IncorrectPublicAddress

Incorrect Public Address provided

MissingConnection

Missing connection

UnexpectedError(String)

A supposedly impossible internal error occurred

UnspecifiedLocalIp

Unspecified local IP address

UnresolvedPublicIp

Couldn’t resolve Public IP address

Trait Implementations

impl Debug for Error[src]

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

Formats the value using the given formatter. Read more

impl Display for Error[src]

fn fmt(&self, __formatter: &mut Formatter<'_>) -> Result[src]

Formats the value using the given formatter. Read more

impl Error for Error[src]

fn source(&self) -> Option<&(dyn Error + 'static)>[src]

The lower-level source of this error, if any. Read more

fn backtrace(&self) -> Option<&Backtrace>[src]

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

Returns a stack backtrace, if available, of where this error occurred. Read more

fn description(&self) -> &str1.0.0[src]

👎 Deprecated since 1.42.0:

use the Display impl or to_string()

fn cause(&self) -> Option<&dyn Error>1.0.0[src]

👎 Deprecated since 1.33.0:

replaced by Error::source, which can support downcasting

impl From<AddAnyPortError> for Error[src]

fn from(source: AddAnyPortError) -> Self[src]

Performs the conversion.

impl From<AddPortError> for Error[src]

fn from(source: AddPortError) -> Self[src]

Performs the conversion.

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

fn from(source: Error) -> Self[src]

Performs the conversion.

impl From<ConnectError> for Error[src]

fn from(source: ConnectError) -> Self[src]

Performs the conversion.

impl From<ConnectionError> for Error[src]

fn from(source: ConnectionError) -> Self[src]

Performs the conversion.

impl From<DecodeError> for Error[src]

fn from(source: DecodeError) -> Self[src]

Performs the conversion.

impl From<EndpointError> for Error[src]

fn from(source: EndpointError) -> Self[src]

Performs the conversion.

impl From<Error> for Error[src]

fn from(source: Error) -> Self[src]

Performs the conversion.

impl From<RcgenError> for Error[src]

fn from(source: RcgenError) -> Self[src]

Performs the conversion.

impl From<ReadExactError> for Error[src]

fn from(source: ReadExactError) -> Self[src]

Performs the conversion.

impl From<SearchError> for Error[src]

fn from(source: SearchError) -> Self[src]

Performs the conversion.

impl From<TLSError> for Error[src]

fn from(source: TLSError) -> Self[src]

Performs the conversion.

impl From<WriteError> for Error[src]

fn from(source: WriteError) -> Self[src]

Performs the conversion.

Auto Trait Implementations

impl !RefUnwindSafe for Error

impl Send for Error

impl Sync for Error

impl Unpin for Error

impl !UnwindSafe for Error

Blanket Implementations

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

pub fn type_id(&self) -> TypeId[src]

Gets the TypeId of self. Read more

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

pub fn borrow(&self) -> &T[src]

Immutably borrows from an owned value. Read more

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

pub fn borrow_mut(&mut self) -> &mut T[src]

Mutably borrows from an owned value. Read more

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

pub fn from(t: T) -> T[src]

Performs the conversion.

impl<T> Instrument for T[src]

fn instrument(self, span: Span) -> Instrumented<Self>[src]

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more

fn in_current_span(self) -> Instrumented<Self>[src]

Instruments this type with the current Span, returning an Instrumented wrapper. Read more

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

pub fn into(self) -> U[src]

Performs the conversion.

impl<T> ToString for T where
    T: Display + ?Sized
[src]

pub default fn to_string(&self) -> String[src]

Converts the given value to a String. Read more

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.

pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>[src]

Performs the conversion.

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.

pub fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>[src]

Performs the conversion.

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

pub fn vzip(self) -> V