azure_iot_operations_protocol::common::aio_protocol_error

Struct AIOProtocolError

Source
pub struct AIOProtocolError {
Show 14 fields pub message: Option<String>, pub kind: AIOProtocolErrorKind, pub is_shallow: bool, pub is_remote: bool, pub nested_error: Option<Box<dyn Error + Send + Sync>>, pub header_name: Option<String>, pub header_value: Option<String>, pub timeout_name: Option<String>, pub timeout_value: Option<Duration>, pub property_name: Option<String>, pub property_value: Option<Value>, pub command_name: Option<String>, pub protocol_version: Option<String>, pub supported_protocol_major_versions: Option<Vec<u16>>,
}
Expand description

Represents an error that occurred in the Azure IoT Operations Protocol

Fields§

§message: Option<String>

The error message

§kind: AIOProtocolErrorKind

The specific kind of error that occurred

§is_shallow: bool

True if the error was identified immediately after the API was called, prior to any attempted network communication

§is_remote: bool

True if the error was detected by a remote component

§nested_error: Option<Box<dyn Error + Send + Sync>>

Error from a dependent component that caused this error

§header_name: Option<String>

The name of a MQTT header that is missing or has an invalid value

§header_value: Option<String>

The value of a MQTT header that is invalid

§timeout_name: Option<String>

The name of a timeout condition that elapsed

§timeout_value: Option<Duration>

The duration of a timeout condition that elapsed

§property_name: Option<String>

The name of a function argument or a field in a struct or enum, configuration file, or environment variable that is missing or has an invalid value

§property_value: Option<Value>

The value of a function argument or a field in a struct or enum, configuration file, or environment variable that is invalid

§command_name: Option<String>

The name of a command relevant to the error being reported

§protocol_version: Option<String>

The protocol version of the command request or response that was not supported.

§supported_protocol_major_versions: Option<Vec<u16>>

The acceptable major protocol versions for the command executor if it rejected the command request, or for the command invoker if it rejected the command response.

Implementations§

Source§

impl AIOProtocolError

Source

pub fn new_header_missing_error( header_name: &str, is_remote: bool, message: Option<String>, command_name: Option<String>, ) -> AIOProtocolError

Creates a new AIOProtocolError for a missing MQTT header

Source

pub fn new_header_invalid_error( header_name: &str, header_value: &str, is_remote: bool, message: Option<String>, command_name: Option<String>, ) -> AIOProtocolError

Creates a new AIOProtocolError for an invalid MQTT header value

Source

pub fn new_payload_invalid_error( is_shallow: bool, is_remote: bool, nested_error: Option<Box<dyn Error + Send + Sync>>, message: Option<String>, command_name: Option<String>, ) -> AIOProtocolError

Creates a new AIOProtocolError for an invalid MQTT payload

Source

pub fn new_timeout_error( is_remote: bool, nested_error: Option<Box<dyn Error + Send + Sync>>, timeout_name: &str, timeout_value: Duration, message: Option<String>, command_name: Option<String>, ) -> AIOProtocolError

Creates a new AIOProtocolError for a timeout

Source

pub fn new_cancellation_error( is_remote: bool, nested_error: Option<Box<dyn Error + Send + Sync>>, message: Option<String>, command_name: Option<String>, ) -> AIOProtocolError

Creates a new AIOProtocolError for a cancellation error

Source

pub fn new_configuration_invalid_error( nested_error: Option<Box<dyn Error + Send + Sync>>, property_name: &str, property_value: Value, message: Option<String>, command_name: Option<String>, ) -> AIOProtocolError

Creates a new AIOProtocolError for an invalid configuration error

Source

pub fn new_state_invalid_error( property_name: &str, property_value: Option<Value>, message: Option<String>, command_name: Option<String>, ) -> AIOProtocolError

Creates a new AIOProtocolError for an invalid state error

Source

pub fn new_internal_logic_error( is_shallow: bool, is_remote: bool, nested_error: Option<Box<dyn Error + Send + Sync>>, property_name: &str, property_value: Option<Value>, message: Option<String>, command_name: Option<String>, ) -> AIOProtocolError

Creates a new AIOProtocolError for an internal logic error

Source

pub fn new_unknown_error( is_remote: bool, is_shallow: bool, nested_error: Option<Box<dyn Error + Send + Sync>>, message: Option<String>, command_name: Option<String>, ) -> AIOProtocolError

Creates a new AIOProtocolError for an unknown error

Source

pub fn new_execution_exception_error( property_name: Option<&str>, property_value: Option<Value>, message: Option<String>, command_name: Option<String>, ) -> AIOProtocolError

Creates a new AIOProtocolError for an execution exception error

Source

pub fn new_mqtt_error( message: Option<String>, nested_error: Box<dyn Error + Send + Sync>, command_name: Option<String>, ) -> AIOProtocolError

Creates a new AIOProtocolError for an MQTT communication error

Source

pub fn new_unsupported_version_error( message: Option<String>, protocol_version: String, supported_protocol_major_versions: Vec<u16>, command_name: Option<String>, is_shallow: bool, is_remote: bool, ) -> AIOProtocolError

Creates a new AIOProtocolError for an unsupported request version error

Source

pub fn ensure_error_message(&mut self)

Sets the error’s message to a default value if a custom message is not already set

Trait Implementations§

Source§

impl Debug for AIOProtocolError

Source§

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

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

impl Display for AIOProtocolError

Source§

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

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

impl Error for AIOProtocolError

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<HLCError> for AIOProtocolError

Source§

fn from(error: HLCError) -> Self

Converts to this type from the input type.
Source§

impl From<ParseHLCError> for AIOProtocolError

Source§

fn from(error: ParseHLCError) -> 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> 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.
§

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

§

fn vzip(self) -> V