ClientError

Enum ClientError 

Source
#[non_exhaustive]
pub enum ClientError {
Show 15 variants IOError(Error), ProtocolError { data: Vec<u8>, message: String, }, AuthenticationError { status: Status, data: Vec<u8>, user_message: String, }, AuthorizationError { status: Status, user_message: String, admin_message: String, }, AccountingError { status: Status, user_message: String, admin_message: String, }, SerializeError(SerializeError), InvalidPacketReceived(DeserializeError), InvalidPacketData, PasswordTooLong, TooManyArguments, InvalidArgument(InvalidArgument), InvalidContext, SequenceNumberMismatch { expected: u8, actual: u8, }, SequenceNumberOverflow, SystemTimeBeforeEpoch(SystemTimeError),
}
Expand description

An error during a TACACS+ exchange.

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

IOError(Error)

An error occurred when reading/writing a packet.

§

ProtocolError

TACACS+ protocol error, e.g. an authentication failure.

Fields

§data: Vec<u8>

The data received from the server.

§message: String

The message sent by the server.

§

AuthenticationError

TACACS+ protocol error, as reported from a server during authentication.

Fields

§status: Status

The status returned from the server, which will not be Pass or Fail.

§data: Vec<u8>

The data received from the server.

§user_message: String

The message sent by the server.

§

AuthorizationError

Error when performing authorization.

Fields

§status: Status

The status received from the server.

§user_message: String

The message returned by the server, to be displayed to the user.

§admin_message: String

The administrative log message returned from the server.

§

AccountingError

Error when performing accounting.

Fields

§status: Status

The status returned by the server.

§user_message: String

The message that can be displayed to the user connected to the client.

§admin_message: String

An administrative log message from the server.

§

SerializeError(SerializeError)

Error when serializing a packet to the wire.

§

InvalidPacketReceived(DeserializeError)

Invalid packet received from a server.

§

InvalidPacketData

Supplied data could not be encoded into a packet.

§

PasswordTooLong

The provided authentication password’s length exceeded the valid range (i.e., 0 to u8::MAX, less some other data stored in the same field).

§

TooManyArguments

Too many arguments were provided to fit in a packet.

§

InvalidArgument(InvalidArgument)

An invalid argument was provided.

§

InvalidContext

Context had an invalid field.

§

SequenceNumberMismatch

Sequence number in reply did not match what was expected.

Fields

§expected: u8

The packet sequence number expected from the server.

§actual: u8

The actual packet sequence number received from the server.

§

SequenceNumberOverflow

Sequence number overflowed in session.

This termination is required per section 4.1 of RFC8907.

§

SystemTimeBeforeEpoch(SystemTimeError)

The system time was set before the Unix epoch, which is problematic for generating timestamps during accounting.

Trait Implementations§

Source§

impl Debug for ClientError

Source§

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

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

impl Display for ClientError

Source§

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

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

impl Error for ClientError

Source§

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

Returns the lower-level source of this error, if any. Read more
1.0.0 · Source§

fn description(&self) -> &str

👎Deprecated since 1.42.0: use the Display impl or to_string()
1.0.0 · Source§

fn cause(&self) -> Option<&dyn Error>

👎Deprecated since 1.33.0: replaced by Error::source, which can support downcasting
Source§

fn provide<'a>(&'a self, request: &mut Request<'a>)

🔬This is a nightly-only experimental API. (error_generic_member_access)
Provides type-based access to context intended for error reports. Read more
Source§

impl From<DeserializeError> for ClientError

Source§

fn from(source: DeserializeError) -> Self

Converts to this type from the input type.
Source§

impl From<Error> for ClientError

Source§

fn from(source: Error) -> Self

Converts to this type from the input type.
Source§

impl From<InvalidArgument> for ClientError

Source§

fn from(source: InvalidArgument) -> Self

Converts to this type from the input type.
Source§

impl From<SerializeError> for ClientError

Source§

fn from(source: SerializeError) -> Self

Converts to this type from the input type.
Source§

impl From<SystemTimeError> for ClientError

Source§

fn from(source: SystemTimeError) -> Self

Converts to this type from the input type.

Auto Trait Implementations§

Blanket Implementations§

Source§

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

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

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

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where 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 T
where 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> Same for T

Source§

type Output = T

Should always be Self
Source§

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

Source§

fn to_string(&self) -> String

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

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

Source§

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 T
where U: TryFrom<T>,

Source§

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.
Source§

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

Source§

fn vzip(self) -> V