Skip to main content

Status

Enum Status 

Source
#[non_exhaustive]
pub enum Status {
Show 36 variants Success, Failure, InvalidSubscription, UnsupportedAccess, UnsupportedEndpoint, InvalidAction, UnsupportedCommand, InvalidCommand, UnsupportedAttribute, ConstraintError, UnsupportedWrite, ResourceExhausted, NotFound, UnreportableAttribute, InvalidDataType, UnsupportedRead, DataVersionMismatch, Timeout, UnsupportedNode, Busy, AccessRestricted, UnsupportedCluster, NoUpstreamSubscription, NeedsTimedInteraction, UnsupportedEvent, PathsExhausted, TimedRequestMismatch, FailsafeRequired, InvalidInState, NoCommandResponse, TermsAndConditionsChanged, MaintenanceRequired, DynamicConstraintError, AlreadyExists, InvalidTransportType, Reserved(u8),
}
Expand description

A status code (§8.10.1).

SUCCESS and FAILURE are the two general outcomes; everything else says which check failed, and a client is expected to distinguish them — §8.10 exists so that “attribute does not exist” and “you may not read it” are different answers.

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

Success

0x00 — “Operation was successful.”

§

Failure

0x01 — “Operation was not successful.”

§

InvalidSubscription

0x7D — “Subscription ID is not active.”

§

UnsupportedAccess

0x7E — the sender lacks the privilege this action needs. Distinct from Status::UnsupportedAttribute on purpose: which one is returned tells a client whether the thing exists.

§

UnsupportedEndpoint

0x7F — “The endpoint indicated is unsupported.”

§

InvalidAction

0x80 — “The action is malformed, has missing fields, or fields with invalid values. Action not carried out.”

§

UnsupportedCommand

0x81 — “The indicated command ID is not supported on the cluster instance. Command not carried out.”

§

InvalidCommand

0x85 — “The cluster command is malformed, has missing fields, or fields with invalid values. Command not carried out.”

§

UnsupportedAttribute

0x86 — “The indicated attribute ID, field ID or list entry does not exist for an attribute path.”

§

ConstraintError

0x87 — “Out of range error or set to a reserved value. Attribute keeps its old value.”

§

UnsupportedWrite

0x88 — “Attempt to write a read-only attribute.”

§

ResourceExhausted

0x89 — “An action or operation failed due to insufficient available resources.”

§

NotFound

0x8B — “The indicated data field or entry could not be found.”

§

UnreportableAttribute

0x8C — “Reports cannot be issued for this attribute.”

§

InvalidDataType

0x8D — “The data type indicated is undefined or invalid.”

§

UnsupportedRead

0x8F — “Attempt to read a write-only attribute.”

§

DataVersionMismatch

0x92 — “Cluster instance data version did not match request path”. What a DataVersionFilter produces when the client’s cached version is stale.

§

Timeout

0x94 — “The transaction was aborted due to time being exceeded.”

§

UnsupportedNode

0x9B — “The node ID indicated is not supported.”

§

Busy

0x9C — “The receiver is busy processing another action.”

§

AccessRestricted

0x9D — access is barred by an Access Restriction List (§6.6).

§

UnsupportedCluster

0xC3 — “The cluster indicated is not supported.”

§

NoUpstreamSubscription

0xC5 — “Used by proxies to convey to clients the lack of an upstream subscription.”

§

NeedsTimedInteraction

0xC6 — “A Untimed Write or Untimed Invoke interaction was received for an attribute or command requiring a Timed interaction.”

§

UnsupportedEvent

0xC7 — “The indicated event ID is not supported.”

§

PathsExhausted

0xC8 — “The receiver has insufficient resources to process all the paths in the request.”

§

TimedRequestMismatch

0xC9 — a TimedRequest flag that disagrees with whether a Timed interaction is actually in progress.

§

FailsafeRequired

0xCA — “A request requiring a Fail-safe context was invoked without one.”

§

InvalidInState

0xCB — “The received request cannot be handled due to the current operational state of the device.”

§

NoCommandResponse

0xCC — “A CommandDataIB is missing a response.”

§

TermsAndConditionsChanged

0xCD — the node requires updated Terms and Conditions acceptance.

§

MaintenanceRequired

0xCE — the node requires user maintenance before it can serve this request.

§

DynamicConstraintError

0xCF — “The value for the data type was not accepted due to runtime validation issues.”

Distinct from Status::ConstraintError on purpose: that one means the value was outside the schema’s range, this one that it was inside the schema and wrong for the device’s current state — a setpoint below the heating limit, say.

§

AlreadyExists

0xD0 — “Attempt to create an entity that already exists or create an entity with an identifier that is already in use.”

§

InvalidTransportType

0xD1 — “Attempt to process on a transport type not valid for this element.”

§8.8.2.3 step b.iv: what a command with the Large Message quality (§7.7.5) answers when it arrives over UDP rather than TCP.

§

Reserved(u8)

A value §8.10.1 marks reserved, or one this revision does not know.

Kept rather than folded into Status::Failure: a proxy that had to substitute a code it could represent would be inventing an answer, and a status invented in the middle of a path is worse than one that is merely obsolete.

Implementations§

Source§

impl Status

Source

pub const fn value(self) -> u8

The code a peer sends.

Source

pub const fn from_value(value: u8) -> Self

The status a code names.

Source

pub const fn is_success(self) -> bool

Whether this is Status::Success.

Trait Implementations§

Source§

impl Clone for Status

Source§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Copy for Status

Source§

impl Debug for Status

Source§

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

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

impl Default for Status

Source§

fn default() -> Self

Returns the “default value” for a type. Read more
Source§

impl Display for Status

Source§

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

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

impl Eq for Status

Source§

impl From<Status> for StatusIb

Source§

fn from(status: Status) -> Self

Converts to this type from the input type.
Source§

impl Hash for Status

Source§

fn hash<__H: Hasher>(&self, state: &mut __H)

Feeds this value into the given Hasher. Read more
1.3.0 · Source§

fn hash_slice<H>(data: &[Self], state: &mut H)
where H: Hasher, Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
Source§

impl Ord for Status

Source§

fn cmp(&self, other: &Self) -> Ordering

This method returns an Ordering between self and other. Read more
1.21.0 (const: unstable) · Source§

fn max(self, other: Self) -> Self
where Self: Sized,

Compares and returns the maximum of two values. Read more
1.21.0 (const: unstable) · Source§

fn min(self, other: Self) -> Self
where Self: Sized,

Compares and returns the minimum of two values. Read more
1.50.0 (const: unstable) · Source§

fn clamp(self, min: Self, max: Self) -> Self
where Self: Sized,

Restrict a value to a certain interval. Read more
Source§

fn clamp_to<R>(self, range: R) -> Self
where Self: Sized, R: ClampBounds<Self>,

🔬This is a nightly-only experimental API. (clamp_to)
Restrict a value to a certain range. Read more
Source§

impl PartialEq for Status

Source§

fn eq(&self, other: &Self) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

impl PartialOrd for Status

Source§

fn partial_cmp(&self, other: &Self) -> Option<Ordering>

This method returns an ordering between self and other values if one exists. Read more
1.0.0 (const: unstable) · Source§

fn lt(&self, other: &Rhs) -> bool

Tests less than (for self and other) and is used by the < operator. Read more
1.0.0 (const: unstable) · Source§

fn le(&self, other: &Rhs) -> bool

Tests less than or equal to (for self and other) and is used by the <= operator. Read more
1.0.0 (const: unstable) · Source§

fn gt(&self, other: &Rhs) -> bool

Tests greater than (for self and other) and is used by the > operator. Read more
1.0.0 (const: unstable) · Source§

fn ge(&self, other: &Rhs) -> bool

Tests greater than or equal to (for self and other) and is used by the >= operator. Read more
Source§

impl StructuralPartialEq for Status

Auto Trait Implementations§

§

impl Forget for Status

§

impl Freeze for Status

§

impl Move for Status

§

impl RefUnwindSafe for Status

§

impl Send for Status

§

impl Sync for Status

§

impl Unpin for Status

§

impl UnsafeUnpin for Status

§

impl UnwindSafe for Status

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> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. 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> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
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.