Struct sandwich::ErrorCode

source ·
pub struct ErrorCode { /* private fields */ }
Expand description

An error code. An error code consists of an error code based on a protobuf enum - ProtoBasedErrorCode and an arbitrary string.

Implementations§

source§

impl ErrorCode

Implements ErrorCode.

source

pub fn code(&self) -> &ProtoBasedErrorCode

Returns the protobuf based error code.

source

pub fn is(&self, pbcode: &impl Borrow<ProtoBasedErrorCode>) -> bool

Compares the protobuf based error code with another.

source§

impl ErrorCode

Implements ErrorCode.

source

pub fn msg(&self) -> Option<&str>

Returns the message, if any.

Trait Implementations§

source§

impl Borrow<ProtoBasedErrorCode> for ErrorCode

source§

fn borrow(&self) -> &ProtoBasedErrorCode

Immutably borrows from an owned value. Read more
source§

impl Debug for ErrorCode

source§

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

Formats the value using the given formatter. Read more
source§

impl Display for ErrorCode

Implements std::fmt::Display for ErrorCode.

source§

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

Formats the value using the given formatter. Read more
source§

impl From<&ErrorCode> for (i32, i32)

Implements [Into<(i32, i32)>] for ErrorCode. The first i32 is the error kind, the second one is the error code.

source§

fn from(ec: &ErrorCode) -> Self

Converts to this type from the input type.
source§

impl<S> From<(ALPNError, &S)> for ErrorCodewhere S: AsRef<str>,

Instantiates an ErrorCode from an error enum and a string.

source§

fn from((v, s): (ALPNError, &S)) -> Self

Converts to this type from the input type.
source§

impl From<(ALPNError, &str)> for ErrorCode

Instantiates an ErrorCode from an error enum and a string.

source§

fn from((v, s): (ALPNError, &str)) -> Self

Converts to this type from the input type.
source§

impl From<(ALPNError, String)> for ErrorCode

Instantiates an ErrorCode from an error enum and a String.

source§

fn from((v, s): (ALPNError, String)) -> Self

Converts to this type from the input type.
source§

impl<S> From<(APIError, &S)> for ErrorCodewhere S: AsRef<str>,

Instantiates an ErrorCode from an error enum and a string.

source§

fn from((v, s): (APIError, &S)) -> Self

Converts to this type from the input type.
source§

impl From<(APIError, &str)> for ErrorCode

Instantiates an ErrorCode from an error enum and a string.

source§

fn from((v, s): (APIError, &str)) -> Self

Converts to this type from the input type.
source§

impl From<(APIError, String)> for ErrorCode

Instantiates an ErrorCode from an error enum and a String.

source§

fn from((v, s): (APIError, String)) -> Self

Converts to this type from the input type.
source§

impl<S> From<(ASN1Error, &S)> for ErrorCodewhere S: AsRef<str>,

Instantiates an ErrorCode from an error enum and a string.

source§

fn from((v, s): (ASN1Error, &S)) -> Self

Converts to this type from the input type.
source§

impl From<(ASN1Error, &str)> for ErrorCode

Instantiates an ErrorCode from an error enum and a string.

source§

fn from((v, s): (ASN1Error, &str)) -> Self

Converts to this type from the input type.
source§

impl From<(ASN1Error, String)> for ErrorCode

Instantiates an ErrorCode from an error enum and a String.

source§

fn from((v, s): (ASN1Error, String)) -> Self

Converts to this type from the input type.
source§

impl<S> From<(CertificateError, &S)> for ErrorCodewhere S: AsRef<str>,

Instantiates an ErrorCode from an error enum and a string.

source§

fn from((v, s): (CertificateError, &S)) -> Self

Converts to this type from the input type.
source§

impl From<(CertificateError, &str)> for ErrorCode

Instantiates an ErrorCode from an error enum and a string.

source§

fn from((v, s): (CertificateError, &str)) -> Self

Converts to this type from the input type.
source§

impl From<(CertificateError, String)> for ErrorCode

Instantiates an ErrorCode from an error enum and a String.

source§

fn from((v, s): (CertificateError, String)) -> Self

Converts to this type from the input type.
source§

impl<S> From<(ConfigurationError, &S)> for ErrorCodewhere S: AsRef<str>,

Instantiates an ErrorCode from an error enum and a string.

source§

fn from((v, s): (ConfigurationError, &S)) -> Self

Converts to this type from the input type.
source§

impl From<(ConfigurationError, &str)> for ErrorCode

Instantiates an ErrorCode from an error enum and a string.

source§

fn from((v, s): (ConfigurationError, &str)) -> Self

Converts to this type from the input type.
source§

impl From<(ConfigurationError, String)> for ErrorCode

Instantiates an ErrorCode from an error enum and a String.

source§

fn from((v, s): (ConfigurationError, String)) -> Self

Converts to this type from the input type.
source§

impl<S> From<(DataSourceError, &S)> for ErrorCodewhere S: AsRef<str>,

Instantiates an ErrorCode from an error enum and a string.

source§

fn from((v, s): (DataSourceError, &S)) -> Self

Converts to this type from the input type.
source§

impl From<(DataSourceError, &str)> for ErrorCode

Instantiates an ErrorCode from an error enum and a string.

source§

fn from((v, s): (DataSourceError, &str)) -> Self

Converts to this type from the input type.
source§

impl From<(DataSourceError, String)> for ErrorCode

Instantiates an ErrorCode from an error enum and a String.

source§

fn from((v, s): (DataSourceError, String)) -> Self

Converts to this type from the input type.
source§

impl<S> From<(HandshakeError, &S)> for ErrorCodewhere S: AsRef<str>,

Instantiates an ErrorCode from an error enum and a string.

source§

fn from((v, s): (HandshakeError, &S)) -> Self

Converts to this type from the input type.
source§

impl From<(HandshakeError, &str)> for ErrorCode

Instantiates an ErrorCode from an error enum and a string.

source§

fn from((v, s): (HandshakeError, &str)) -> Self

Converts to this type from the input type.
source§

impl From<(HandshakeError, String)> for ErrorCode

Instantiates an ErrorCode from an error enum and a String.

source§

fn from((v, s): (HandshakeError, String)) -> Self

Converts to this type from the input type.
source§

impl<S> From<(KEMError, &S)> for ErrorCodewhere S: AsRef<str>,

Instantiates an ErrorCode from an error enum and a string.

source§

fn from((v, s): (KEMError, &S)) -> Self

Converts to this type from the input type.
source§

impl From<(KEMError, &str)> for ErrorCode

Instantiates an ErrorCode from an error enum and a string.

source§

fn from((v, s): (KEMError, &str)) -> Self

Converts to this type from the input type.
source§

impl From<(KEMError, String)> for ErrorCode

Instantiates an ErrorCode from an error enum and a String.

source§

fn from((v, s): (KEMError, String)) -> Self

Converts to this type from the input type.
source§

impl<S> From<(PrivateKeyError, &S)> for ErrorCodewhere S: AsRef<str>,

Instantiates an ErrorCode from an error enum and a string.

source§

fn from((v, s): (PrivateKeyError, &S)) -> Self

Converts to this type from the input type.
source§

impl From<(PrivateKeyError, &str)> for ErrorCode

Instantiates an ErrorCode from an error enum and a string.

source§

fn from((v, s): (PrivateKeyError, &str)) -> Self

Converts to this type from the input type.
source§

impl From<(PrivateKeyError, String)> for ErrorCode

Instantiates an ErrorCode from an error enum and a String.

source§

fn from((v, s): (PrivateKeyError, String)) -> Self

Converts to this type from the input type.
source§

impl<S> From<(ProtoBasedErrorCode, &S)> for ErrorCodewhere S: AsRef<str>,

source§

fn from((ec, s): (ProtoBasedErrorCode, &S)) -> Self

Converts to this type from the input type.
source§

impl From<(ProtoBasedErrorCode, &str)> for ErrorCode

Instantiates an ErrorCode by consuming a ProtoBasedErrorCode and a string.

source§

fn from((ec, s): (ProtoBasedErrorCode, &str)) -> Self

Converts to this type from the input type.
source§

impl From<(ProtoBasedErrorCode, String)> for ErrorCode

Instantiates an ErrorCode by consuming a ProtoBasedErrorCode and a string.

source§

fn from((ec, s): (ProtoBasedErrorCode, String)) -> Self

Converts to this type from the input type.
source§

impl<S> From<(ProtobufError, &S)> for ErrorCodewhere S: AsRef<str>,

Instantiates an ErrorCode from an error enum and a string.

source§

fn from((v, s): (ProtobufError, &S)) -> Self

Converts to this type from the input type.
source§

impl From<(ProtobufError, &str)> for ErrorCode

Instantiates an ErrorCode from an error enum and a string.

source§

fn from((v, s): (ProtobufError, &str)) -> Self

Converts to this type from the input type.
source§

impl From<(ProtobufError, String)> for ErrorCode

Instantiates an ErrorCode from an error enum and a String.

source§

fn from((v, s): (ProtobufError, String)) -> Self

Converts to this type from the input type.
source§

impl<S> From<(SocketError, &S)> for ErrorCodewhere S: AsRef<str>,

Instantiates an ErrorCode from an error enum and a string.

source§

fn from((v, s): (SocketError, &S)) -> Self

Converts to this type from the input type.
source§

impl From<(SocketError, &str)> for ErrorCode

Instantiates an ErrorCode from an error enum and a string.

source§

fn from((v, s): (SocketError, &str)) -> Self

Converts to this type from the input type.
source§

impl From<(SocketError, String)> for ErrorCode

Instantiates an ErrorCode from an error enum and a String.

source§

fn from((v, s): (SocketError, String)) -> Self

Converts to this type from the input type.
source§

impl<S> From<(SystemError, &S)> for ErrorCodewhere S: AsRef<str>,

Instantiates an ErrorCode from an error enum and a string.

source§

fn from((v, s): (SystemError, &S)) -> Self

Converts to this type from the input type.
source§

impl From<(SystemError, &str)> for ErrorCode

Instantiates an ErrorCode from an error enum and a string.

source§

fn from((v, s): (SystemError, &str)) -> Self

Converts to this type from the input type.
source§

impl From<(SystemError, String)> for ErrorCode

Instantiates an ErrorCode from an error enum and a String.

source§

fn from((v, s): (SystemError, String)) -> Self

Converts to this type from the input type.
source§

impl<S> From<(TLSConfigurationError, &S)> for ErrorCodewhere S: AsRef<str>,

Instantiates an ErrorCode from an error enum and a string.

source§

fn from((v, s): (TLSConfigurationError, &S)) -> Self

Converts to this type from the input type.
source§

impl From<(TLSConfigurationError, &str)> for ErrorCode

Instantiates an ErrorCode from an error enum and a string.

source§

fn from((v, s): (TLSConfigurationError, &str)) -> Self

Converts to this type from the input type.
source§

impl From<(TLSConfigurationError, String)> for ErrorCode

Instantiates an ErrorCode from an error enum and a String.

source§

fn from((v, s): (TLSConfigurationError, String)) -> Self

Converts to this type from the input type.
source§

impl<S> From<(TunnelError, &S)> for ErrorCodewhere S: AsRef<str>,

Instantiates an ErrorCode from an error enum and a string.

source§

fn from((v, s): (TunnelError, &S)) -> Self

Converts to this type from the input type.
source§

impl From<(TunnelError, &str)> for ErrorCode

Instantiates an ErrorCode from an error enum and a string.

source§

fn from((v, s): (TunnelError, &str)) -> Self

Converts to this type from the input type.
source§

impl From<(TunnelError, String)> for ErrorCode

Instantiates an ErrorCode from an error enum and a String.

source§

fn from((v, s): (TunnelError, String)) -> Self

Converts to this type from the input type.
source§

impl From<ALPNError> for ErrorCode

Implements [From<sandwich_proto::ErrorEnum>] for ErrorCode.

source§

fn from(v: ALPNError) -> Self

Converts to this type from the input type.
source§

impl From<APIError> for ErrorCode

Implements [From<sandwich_proto::ErrorEnum>] for ErrorCode.

source§

fn from(v: APIError) -> Self

Converts to this type from the input type.
source§

impl From<ASN1Error> for ErrorCode

Implements [From<sandwich_proto::ErrorEnum>] for ErrorCode.

source§

fn from(v: ASN1Error) -> Self

Converts to this type from the input type.
source§

impl From<CertificateError> for ErrorCode

Implements [From<sandwich_proto::ErrorEnum>] for ErrorCode.

source§

fn from(v: CertificateError) -> Self

Converts to this type from the input type.
source§

impl From<ConfigurationError> for ErrorCode

Implements [From<sandwich_proto::ErrorEnum>] for ErrorCode.

source§

fn from(v: ConfigurationError) -> Self

Converts to this type from the input type.
source§

impl From<DataSourceError> for ErrorCode

Implements [From<sandwich_proto::ErrorEnum>] for ErrorCode.

source§

fn from(v: DataSourceError) -> Self

Converts to this type from the input type.
source§

impl From<ErrorCode> for Error

Instantiates an Error from an ErrorCode.

source§

fn from(e: ErrorCode) -> Self

Converts to this type from the input type.
source§

impl From<HandshakeError> for ErrorCode

Implements [From<sandwich_proto::ErrorEnum>] for ErrorCode.

source§

fn from(v: HandshakeError) -> Self

Converts to this type from the input type.
source§

impl From<KEMError> for ErrorCode

Implements [From<sandwich_proto::ErrorEnum>] for ErrorCode.

source§

fn from(v: KEMError) -> Self

Converts to this type from the input type.
source§

impl From<PrivateKeyError> for ErrorCode

Implements [From<sandwich_proto::ErrorEnum>] for ErrorCode.

source§

fn from(v: PrivateKeyError) -> Self

Converts to this type from the input type.
source§

impl From<ProtoBasedErrorCode> for ErrorCode

Instantiates an ErrorCode by consuming a ProtoBasedErrorCode.

source§

fn from(ec: ProtoBasedErrorCode) -> Self

Converts to this type from the input type.
source§

impl From<ProtobufError> for ErrorCode

Implements [From<sandwich_proto::ErrorEnum>] for ErrorCode.

source§

fn from(v: ProtobufError) -> Self

Converts to this type from the input type.
source§

impl From<SocketError> for ErrorCode

Implements [From<sandwich_proto::ErrorEnum>] for ErrorCode.

source§

fn from(v: SocketError) -> Self

Converts to this type from the input type.
source§

impl From<SystemError> for ErrorCode

Implements [From<sandwich_proto::ErrorEnum>] for ErrorCode.

source§

fn from(v: SystemError) -> Self

Converts to this type from the input type.
source§

impl From<TLSConfigurationError> for ErrorCode

Implements [From<sandwich_proto::ErrorEnum>] for ErrorCode.

source§

fn from(v: TLSConfigurationError) -> Self

Converts to this type from the input type.
source§

impl From<TunnelError> for ErrorCode

Implements [From<sandwich_proto::ErrorEnum>] for ErrorCode.

source§

fn from(v: TunnelError) -> Self

Converts to this type from the input type.
source§

impl Shr<ErrorCode> for Error

Appends an Error into the chain, using the >> operator.

§

type Output = Error

The resulting type after applying the >> operator.
source§

fn shr(self, e: ErrorCode) -> Self::Output

Performs the >> operation. Read more
source§

impl Shr<ErrorCode> for ErrorCode

Implements operator>> between two ErrorCode to produce an Error.

§

type Output = Error

The resulting type after applying the >> operator.
source§

fn shr(self, e: ErrorCode) -> Self::Output

Performs the >> operation. Read more
source§

impl TryFrom<(i32, i32)> for ErrorCode

Implements TryFrom for ErrorCode.

§

type Error = Error

The type returned in the event of a conversion error.
source§

fn try_from((kind, ec): (i32, i32)) -> Result<Self>

Performs the conversion.

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for Twhere T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for Twhere U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

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

source§

impl<T> ToString for Twhere T: Display + ?Sized,

source§

default fn to_string(&self) -> String

Converts the given value to a String. Read more
source§

impl<T, U> TryFrom<U> for Twhere U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

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

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

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

Performs the conversion.