Skip to main content

Error

Enum Error 

Source
#[non_exhaustive]
pub enum Error {
Show 22 variants SerialDeviceInUseOrDisconnected(SerialDeviceInUseOrDisconnectedError), Io(Error), TryIntoSend(TryIntoSendError), AsciiPacketMissingStart(AsciiPacketMissingStartError), AsciiPacketMissingEnd(AsciiPacketMissingEndError), AsciiPacketMalformed(AsciiPacketMalformedError), AsciiInvalidChecksum(AsciiInvalidChecksumError), AsciiUnexpectedResponse(AsciiUnexpectedResponseError), AsciiUnexpectedPacket(AsciiUnexpectedPacketError), AsciiCheckFlag(AsciiCheckFlagError), AsciiCheckStatus(AsciiCheckStatusError<AnyResponse>), AsciiCheckWarning(AsciiCheckWarningError<AnyResponse>), AsciiCheckData(AsciiCheckDataError<AnyResponse>), AsciiCheckCustom(AsciiCheckCustomError<AnyResponse>), AsciiCommandSplit(AsciiCommandSplitError), AsciiReservedCharacter(AsciiReservedCharacterError), BinaryCommandFailure(BinaryCommandFailureError), BinaryUnexpectedTarget(BinaryUnexpectedTargetError), BinaryUnexpectedId(BinaryUnexpectedIdError), BinaryUnexpectedCommand(BinaryUnexpectedCommandError), Conversion(ConversionError), DuplicateAddress(DuplicateAddressError),
}
Available on crate features ascii and binary only.
Expand description

Any error returned by this library.

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

SerialDeviceInUseOrDisconnected(SerialDeviceInUseOrDisconnectedError)

§

Io(Error)

§

TryIntoSend(TryIntoSendError)

§

AsciiPacketMissingStart(AsciiPacketMissingStartError)

§

AsciiPacketMissingEnd(AsciiPacketMissingEndError)

§

AsciiPacketMalformed(AsciiPacketMalformedError)

§

AsciiInvalidChecksum(AsciiInvalidChecksumError)

§

AsciiUnexpectedResponse(AsciiUnexpectedResponseError)

§

AsciiUnexpectedPacket(AsciiUnexpectedPacketError)

§

AsciiCheckFlag(AsciiCheckFlagError)

§

AsciiCheckStatus(AsciiCheckStatusError<AnyResponse>)

§

AsciiCheckWarning(AsciiCheckWarningError<AnyResponse>)

§

AsciiCheckData(AsciiCheckDataError<AnyResponse>)

§

AsciiCheckCustom(AsciiCheckCustomError<AnyResponse>)

§

AsciiCommandSplit(AsciiCommandSplitError)

§

AsciiReservedCharacter(AsciiReservedCharacterError)

§

BinaryCommandFailure(BinaryCommandFailureError)

§

BinaryUnexpectedTarget(BinaryUnexpectedTargetError)

§

BinaryUnexpectedId(BinaryUnexpectedIdError)

§

BinaryUnexpectedCommand(BinaryUnexpectedCommandError)

§

Conversion(ConversionError)

§

DuplicateAddress(DuplicateAddressError)

Implementations§

Source§

impl Error

Source

pub fn is_timeout(&self) -> bool

A convenience function for determining if the error is due to the port timing out.

Note that a timeout error is a kind of IO error, so is_io will also return true for timeout errors.

Source§

impl Error

Source

pub fn is_io(&self) -> bool

A convenience function for determining if the error is an IO error.

Trait Implementations§

Source§

impl Debug for Error

Source§

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

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

impl Display for Error

Source§

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

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

impl Error for Error

1.30.0 · 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<!> for Error

Source§

fn from(_: Infallible) -> Self

Converts to this type from the input type.
Source§

impl From<AsciiCheckCustomError<AnyResponse>> for Error

Source§

fn from(other: AsciiCheckCustomError<AnyResponse>) -> Self

Converts to this type from the input type.
Source§

impl From<AsciiCheckDataError<AnyResponse>> for Error

Source§

fn from(other: AsciiCheckDataError<AnyResponse>) -> Self

Converts to this type from the input type.
Source§

impl From<AsciiCheckError<AnyResponse>> for Error

Source§

fn from(other: AsciiCheckError<AnyResponse>) -> Self

Converts to this type from the input type.
Source§

impl<R> From<AsciiCheckError<R>> for Error

Source§

fn from(other: AsciiCheckError<R>) -> Self

Converts to this type from the input type.
Source§

impl From<AsciiCheckFlagError> for Error

Source§

fn from(other: AsciiCheckFlagError) -> Self

Converts to this type from the input type.
Source§

impl From<AsciiCheckStatusError<AnyResponse>> for Error

Source§

fn from(other: AsciiCheckStatusError<AnyResponse>) -> Self

Converts to this type from the input type.
Source§

impl From<AsciiCheckWarningError<AnyResponse>> for Error

Source§

fn from(other: AsciiCheckWarningError<AnyResponse>) -> Self

Converts to this type from the input type.
Source§

impl From<AsciiCommandSplitError> for Error

Source§

fn from(other: AsciiCommandSplitError) -> Self

Converts to this type from the input type.
Source§

impl From<AsciiError> for Error

Source§

fn from(other: AsciiError) -> Self

Converts to this type from the input type.
Source§

impl From<AsciiInvalidChecksumError> for Error

Source§

fn from(other: AsciiInvalidChecksumError) -> Self

Converts to this type from the input type.
Source§

impl From<AsciiPacketMalformedError> for Error

Source§

fn from(other: AsciiPacketMalformedError) -> Self

Converts to this type from the input type.
Source§

impl From<AsciiPacketMissingEndError> for Error

Source§

fn from(other: AsciiPacketMissingEndError) -> Self

Converts to this type from the input type.
Source§

impl From<AsciiPacketMissingStartError> for Error

Source§

fn from(other: AsciiPacketMissingStartError) -> Self

Converts to this type from the input type.
Source§

impl From<AsciiProtocolError> for Error

Source§

fn from(other: AsciiProtocolError) -> Self

Converts to this type from the input type.
Source§

impl From<AsciiReservedCharacterError> for Error

Source§

fn from(other: AsciiReservedCharacterError) -> Self

Converts to this type from the input type.
Source§

impl From<AsciiUnexpectedPacketError> for Error

Source§

fn from(other: AsciiUnexpectedPacketError) -> Self

Converts to this type from the input type.
Source§

impl From<AsciiUnexpectedResponseError> for Error

Source§

fn from(other: AsciiUnexpectedResponseError) -> Self

Converts to this type from the input type.
Source§

impl From<BinaryCommandFailureError> for Error

Source§

fn from(other: BinaryCommandFailureError) -> Self

Converts to this type from the input type.
Source§

impl From<BinaryError> for Error

Source§

fn from(other: BinaryError) -> Self

Converts to this type from the input type.
Source§

impl From<BinaryUnexpectedCommandError> for Error

Source§

fn from(other: BinaryUnexpectedCommandError) -> Self

Converts to this type from the input type.
Source§

impl From<BinaryUnexpectedError> for Error

Source§

fn from(other: BinaryUnexpectedError) -> Self

Converts to this type from the input type.
Source§

impl From<BinaryUnexpectedIdError> for Error

Source§

fn from(other: BinaryUnexpectedIdError) -> Self

Converts to this type from the input type.
Source§

impl From<BinaryUnexpectedTargetError> for Error

Source§

fn from(other: BinaryUnexpectedTargetError) -> Self

Converts to this type from the input type.
Source§

impl From<ConversionError> for Error

Source§

fn from(other: ConversionError) -> Self

Converts to this type from the input type.
Source§

impl From<DuplicateAddressError> for Error

Source§

fn from(other: DuplicateAddressError) -> Self

Converts to this type from the input type.
Source§

impl From<Error> for Error

Source§

fn from(other: Error) -> Self

Converts to this type from the input type.
Source§

impl From<Error> for Error

Source§

fn from(other: Error) -> Self

Converts to this type from the input type.
Source§

impl From<SerialDeviceInUseOrDisconnectedError> for Error

Source§

fn from(other: SerialDeviceInUseOrDisconnectedError) -> Self

Converts to this type from the input type.
Source§

impl From<TryIntoSendError> for Error

Source§

fn from(other: TryIntoSendError) -> Self

Converts to this type from the input type.
Source§

impl TryFrom<Error> for SerialDeviceInUseOrDisconnectedError

Source§

type Error = Error

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

fn try_from(other: Error) -> Result<Self, Self::Error>

Performs the conversion.
Source§

impl TryFrom<Error> for Error

Source§

type Error = Error

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

fn try_from(other: Error) -> Result<Self, Self::Error>

Performs the conversion.
Source§

impl TryFrom<Error> for TryIntoSendError

Source§

type Error = Error

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

fn try_from(other: Error) -> Result<Self, Self::Error>

Performs the conversion.
Source§

impl TryFrom<Error> for AsciiPacketMissingStartError

Source§

type Error = Error

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

fn try_from(other: Error) -> Result<Self, Self::Error>

Performs the conversion.
Source§

impl TryFrom<Error> for AsciiPacketMissingEndError

Source§

type Error = Error

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

fn try_from(other: Error) -> Result<Self, Self::Error>

Performs the conversion.
Source§

impl TryFrom<Error> for AsciiPacketMalformedError

Source§

type Error = Error

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

fn try_from(other: Error) -> Result<Self, Self::Error>

Performs the conversion.
Source§

impl TryFrom<Error> for AsciiInvalidChecksumError

Source§

type Error = Error

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

fn try_from(other: Error) -> Result<Self, Self::Error>

Performs the conversion.
Source§

impl TryFrom<Error> for AsciiUnexpectedResponseError

Source§

type Error = Error

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

fn try_from(other: Error) -> Result<Self, Self::Error>

Performs the conversion.
Source§

impl TryFrom<Error> for AsciiUnexpectedPacketError

Source§

type Error = Error

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

fn try_from(other: Error) -> Result<Self, Self::Error>

Performs the conversion.
Source§

impl TryFrom<Error> for AsciiCheckFlagError

Source§

type Error = Error

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

fn try_from(other: Error) -> Result<Self, Self::Error>

Performs the conversion.
Source§

impl TryFrom<Error> for AsciiCheckStatusError<AnyResponse>

Source§

type Error = Error

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

fn try_from(other: Error) -> Result<Self, Self::Error>

Performs the conversion.
Source§

impl TryFrom<Error> for AsciiCheckWarningError<AnyResponse>

Source§

type Error = Error

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

fn try_from(other: Error) -> Result<Self, Self::Error>

Performs the conversion.
Source§

impl TryFrom<Error> for AsciiCheckDataError<AnyResponse>

Source§

type Error = Error

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

fn try_from(other: Error) -> Result<Self, Self::Error>

Performs the conversion.
Source§

impl TryFrom<Error> for AsciiCheckCustomError<AnyResponse>

Source§

type Error = Error

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

fn try_from(other: Error) -> Result<Self, Self::Error>

Performs the conversion.
Source§

impl TryFrom<Error> for AsciiCommandSplitError

Source§

type Error = Error

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

fn try_from(other: Error) -> Result<Self, Self::Error>

Performs the conversion.
Source§

impl TryFrom<Error> for AsciiReservedCharacterError

Source§

type Error = Error

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

fn try_from(other: Error) -> Result<Self, Self::Error>

Performs the conversion.
Source§

impl TryFrom<Error> for BinaryCommandFailureError

Source§

type Error = Error

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

fn try_from(other: Error) -> Result<Self, Self::Error>

Performs the conversion.
Source§

impl TryFrom<Error> for BinaryUnexpectedTargetError

Source§

type Error = Error

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

fn try_from(other: Error) -> Result<Self, Self::Error>

Performs the conversion.
Source§

impl TryFrom<Error> for BinaryUnexpectedIdError

Source§

type Error = Error

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

fn try_from(other: Error) -> Result<Self, Self::Error>

Performs the conversion.
Source§

impl TryFrom<Error> for BinaryUnexpectedCommandError

Source§

type Error = Error

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

fn try_from(other: Error) -> Result<Self, Self::Error>

Performs the conversion.
Source§

impl TryFrom<Error> for ConversionError

Source§

type Error = Error

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

fn try_from(other: Error) -> Result<Self, Self::Error>

Performs the conversion.
Source§

impl TryFrom<Error> for DuplicateAddressError

Source§

type Error = Error

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

fn try_from(other: Error) -> Result<Self, Self::Error>

Performs the conversion.
Source§

impl TryFrom<Error> for AsciiProtocolError

Source§

type Error = Error

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

fn try_from(other: Error) -> Result<Self, Self::Error>

Performs the conversion.
Source§

impl TryFrom<Error> for AsciiError

Source§

type Error = Error

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

fn try_from(other: Error) -> Result<Self, Self::Error>

Performs the conversion.
Source§

impl TryFrom<Error> for BinaryUnexpectedError

Source§

type Error = Error

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

fn try_from(other: Error) -> Result<Self, Self::Error>

Performs the conversion.
Source§

impl TryFrom<Error> for BinaryError

Source§

type Error = Error

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

fn try_from(other: Error) -> Result<Self, Self::Error>

Performs the conversion.
Source§

impl TryFrom<Error> for AsciiCheckError<AnyResponse>

Source§

type Error = Error

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

fn try_from(other: Error) -> Result<Self, Self::Error>

Performs the conversion.

Auto Trait Implementations§

§

impl !RefUnwindSafe for Error

§

impl !UnwindSafe for Error

§

impl Freeze for Error

§

impl Send for Error

§

impl Sync for Error

§

impl Unpin for Error

§

impl UnsafeUnpin for Error

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> 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 = !

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

fn try_from(value: U) -> Result<T, !>

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.