logo

Enum safe_network::client::Error[][src]

#[non_exhaustive]
pub enum Error {
Show 31 variants GenesisKeyMismatch, CouldNotReadHomeDir, CouldNotCreateRootDir, ReceivedUnexpectedEvent, NoNetworkKnowledge, IncomingMessages, FailedToSendSufficentQuery(usizeusize), InsufficientElderConnections(usizeusize), InsufficientElderKnowledge(usizeusizePublicKey), PeerConnection(SocketAddr), EmptyBytesProvided, TooSmallToBeBlob, SpotPaddingNeeded, TooLargeToBeSpot, QueryTimedOut, NoEncryptionObject, NoResponse, UnknownOperationId, UnexpectedQueryResponse(QueryResponse), NetworkDataError(DtError), ErrorMessage { source: ErrorMessage, op_id: OperationId, }, MessagingProtocol(MessagingError), SelfEncryption(Error), ConfigError(Error), IoError(Error), EndpointSetup(ClientEndpointError), QuicP2p(RpcError), QuicP2pConnection(ConnectionError), Serialisation(Box<ErrorKind>), NotEnoughChunks(usizeusize), NotAllDataWasChunked(usizeusize),
}
Expand description

Client Errors

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.

GenesisKeyMismatch

Genesis Key from the config and the PrefixMap mismatch

CouldNotReadHomeDir

Error reading home dir for client

CouldNotCreateRootDir

Error creating root dir for client

ReceivedUnexpectedEvent

Received unexpected event.

NoNetworkKnowledge

Client has not gone through qp2p bootstrap process yet

IncomingMessages

qp2p’s IncomingMessages errores

FailedToSendSufficentQuery(usizeusize)

Tuple Fields

0: usize
1: usize

Could not send queries to sufficient elder to retrieve reliable responses.

InsufficientElderConnections(usizeusize)

Tuple Fields

0: usize
1: usize

Could not connect to sufficient elder to retrieve reliable responses.

InsufficientElderKnowledge(usizeusizePublicKey)

Tuple Fields

0: usize
1: usize

Did not know of sufficient elders in the desired section to get supermajority of repsonses.

PeerConnection(SocketAddr)

Tuple Fields

Peer connection retrieval failed

EmptyBytesProvided

Cannot store empty bytes..

TooSmallToBeBlob

The provided bytes is too small to be a Blob.

SpotPaddingNeeded

Encryption oversized the Spot, so it cannot be stored as a Spot and be encrypted

TooLargeToBeSpot

The provided bytes is too large to be a Spot.

QueryTimedOut

No query response before timeout

NoEncryptionObject

Could not get an encryption object.

NoResponse

Could not query elder.

UnknownOperationId

No operation Id could be found

UnexpectedQueryResponse(QueryResponse)

Tuple Fields

Unexpected response received

NetworkDataError(DtError)

Tuple Fields

Other types errors

ErrorMessage

Fields

source: ErrorMessage

The source of an error message

op_id: OperationId

operation ID that was used to send the query

Errors received from the network via sn_messaging

MessagingProtocol(MessagingError)

Tuple Fields

Errors occurred when serialising or deserialising messages

SelfEncryption(Error)

Tuple Fields

0: Error

self_enryption errors

ConfigError(Error)

Tuple Fields

0: Error

Other types errors

IoError(Error)

Tuple Fields

0: Error

Io error.

EndpointSetup(ClientEndpointError)

Tuple Fields

Endpoint setup error.

QuicP2p(RpcError)

Tuple Fields

QuicP2p error.

QuicP2pConnection(ConnectionError)

Tuple Fields

QuicP2p Connection error.

Serialisation(Box<ErrorKind>)

Tuple Fields

Bincode error

NotEnoughChunks(usizeusize)

Tuple Fields

0: usize
1: usize

Could not retrieve all chunks required to decrypt the data. (expected, error)

NotAllDataWasChunked(usizeusize)

Tuple Fields

0: usize
1: usize

Could not chunk all the data required to encrypt the data. (Expected, Actual)

Trait Implementations

Formats the value using the given formatter. Read more

Formats the value using the given formatter. Read more

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

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

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

👎 Deprecated since 1.42.0:

use the Display impl or to_string()

👎 Deprecated since 1.33.0:

replaced by Error::source, which can support downcasting

Performs the conversion.

Performs the conversion.

Performs the conversion.

Performs the conversion.

Performs the conversion.

Performs the conversion.

Performs the conversion.

Performs the conversion.

Performs the conversion.

Performs the conversion.

Performs the conversion.

Performs the conversion.

Performs the conversion.

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

Performs the conversion.

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

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

The type of the wrapped error after instrumentation

Instrument an Error by bundling it with a SpanTrace Read more

Performs the conversion.

Set the foreground color generically Read more

Set the background color generically. Read more

Change the foreground color to black

Change the foreground color to black

Change the foreground color to red

Change the foreground color to red

Change the foreground color to green

Change the foreground color to green

Change the foreground color to yellow

Change the foreground color to yellow

Change the foreground color to blue

Change the foreground color to blue

Change the foreground color to magenta

Change the foreground color to magenta

Change the foreground color to purple

Change the foreground color to purple

Change the foreground color to cyan

Change the foreground color to cyan

Change the foreground color to white

Change the foreground color to white

Change the foreground color to bright black

Change the foreground color to bright black

Change the foreground color to bright red

Change the foreground color to bright red

Change the foreground color to bright green

Change the foreground color to bright green

Change the foreground color to bright yellow

Change the foreground color to bright yellow

Change the foreground color to bright blue

Change the foreground color to bright blue

Change the foreground color to bright magenta

Change the foreground color to bright magenta

Change the foreground color to bright purple

Change the foreground color to bright purple

Change the foreground color to bright cyan

Change the foreground color to bright cyan

Change the foreground color to bright white

Change the foreground color to bright white

Make the text bold

Make the text dim

Make the text italicized

Make the text italicized

Make the text blink

Make the text blink (but fast!)

Swap the foreground and background colors

Hide the text

Cross out the text

Set the foreground color at runtime. Only use if you do not know which color will be used at compile-time. If the color is constant, use either OwoColorize::fg or a color-specific method, such as OwoColorize::green, Read more

Set the background color at runtime. Only use if you do not know what color to use at compile-time. If the color is constant, use either OwoColorize::bg or a color-specific method, such as OwoColorize::on_yellow, Read more

Sets the foreground color to an RGB value.

Sets the background color to an RGB value.

Apply a runtime-determined style

The alignment of pointer.

The type for initializers.

Initializes a with the given initializer. Read more

Dereferences the given pointer. Read more

Mutably dereferences the given pointer. Read more

Drops the object pointed to by the given pointer. Read more

Should always be Self

Add a header to a Section and indent the body 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.

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more