Skip to main content

StatusCode

Struct StatusCode 

Source
pub struct StatusCode(/* private fields */);
Expand description

OPC UA Status Code.

A status code is a 32-bit value composed of:

  • Bits 31-30: Severity (00=Good, 01=Uncertain, 10=Bad)
  • Bits 29-16: Sub-code
  • Bits 15-0: Info bits

§Examples

use mabi_opcua::types::StatusCode;

let status = StatusCode::GOOD;
assert!(status.is_good());

let status = StatusCode::BAD_NODE_ID_UNKNOWN;
assert!(status.is_bad());

Implementations§

Source§

impl StatusCode

Source

pub const GOOD: Self

The operation was successful.

Source

pub const GOOD_LOCAL_OVERRIDE: Self

The data source is a local value.

Source

pub const GOOD_CLAMPED: Self

The operation completed but resulted in clamped values.

Source

pub const GOOD_NO_DATA: Self

No data exists for the requested time range.

Source

pub const GOOD_MORE_DATA: Self

More data is available for the requested bounds.

Source

pub const GOOD_SUBSCRIPTION_TRANSFERRED: Self

The subscription was transferred.

Source

pub const GOOD_REFRESH_IN_PROGRESS: Self

Refresh in progress.

Source

pub const GOOD_REFRESH_FINISHED: Self

Refresh finished.

Source

pub const UNCERTAIN: Self

The value is uncertain.

Source

pub const UNCERTAIN_LAST_USABLE_VALUE: Self

The data value is from a different source.

Source

pub const UNCERTAIN_SENSOR_NOT_ACCURATE: Self

Sensor failure.

Source

pub const UNCERTAIN_SUB_NORMAL: Self

Sub-normal operation.

Source

pub const UNCERTAIN_INITIAL_VALUE: Self

Initial value.

Source

pub const BAD_UNEXPECTED_ERROR: Self

An unexpected error occurred.

Source

pub const BAD_INTERNAL_ERROR: Self

An internal error occurred.

Source

pub const BAD_OUT_OF_MEMORY: Self

Not enough memory.

Source

pub const BAD_INVALID_ARGUMENT: Self

Invalid argument.

Source

pub const BAD_RESOURCE_UNAVAILABLE: Self

Resource not available.

Source

pub const BAD_COMMUNICATION_ERROR: Self

Communication error.

Source

pub const BAD_ENCODING_ERROR: Self

Encoding error.

Source

pub const BAD_DECODING_ERROR: Self

Decoding error.

Source

pub const BAD_TIMEOUT: Self

Timeout occurred.

Source

pub const BAD_SERVICE_UNSUPPORTED: Self

Service not supported.

Source

pub const BAD_SHUTDOWN: Self

Operation was shut down.

Source

pub const BAD_SERVER_NOT_CONNECTED: Self

Server not connected.

Source

pub const BAD_SERVER_HALTED: Self

Server halted.

Source

pub const BAD_NOTHING_TO_DO: Self

Nothing to do.

Source

pub const BAD_TOO_MANY_OPERATIONS: Self

Too many operations.

Source

pub const BAD_DATA_TYPE_MISMATCH: Self

Data type mismatch.

Source

pub const BAD_NODE_ID_UNKNOWN: Self

Node ID unknown.

Source

pub const BAD_NODE_ID_INVALID: Self

Node ID invalid.

Source

pub const BAD_ATTRIBUTE_ID_INVALID: Self

Attribute ID invalid.

Source

pub const BAD_INDEX_RANGE_INVALID: Self

Index range invalid.

Source

pub const BAD_INDEX_RANGE_NO_DATA: Self

Index range out of bounds.

Source

pub const BAD_DATA_ENCODING_INVALID: Self

Data encoding invalid.

Source

pub const BAD_DATA_ENCODING_UNSUPPORTED: Self

Data encoding unsupported.

Source

pub const BAD_NOT_READABLE: Self

Not readable.

Source

pub const BAD_NOT_WRITABLE: Self

Not writable.

Source

pub const BAD_OUT_OF_RANGE: Self

Out of range.

Source

pub const BAD_NOT_SUPPORTED: Self

Not supported.

Source

pub const BAD_NOT_FOUND: Self

Not found.

Source

pub const BAD_OBJECT_DELETED: Self

Object deleted.

Source

pub const BAD_NOT_IMPLEMENTED: Self

Not implemented.

Source

pub const BAD_MONITORING_MODE_INVALID: Self

Monitoring mode invalid.

Source

pub const BAD_MONITORED_ITEM_ID_INVALID: Self

Monitored item ID invalid.

Source

pub const BAD_MONITORED_ITEM_FILTER_INVALID: Self

Monitored item filter invalid.

Source

pub const BAD_MONITORED_ITEM_FILTER_UNSUPPORTED: Self

Monitored item filter unsupported.

Source

pub const BAD_FILTER_NOT_ALLOWED: Self

Filter not allowed.

Source

pub const BAD_STRUCTURE_MISSING: Self

Structure missing.

Source

pub const BAD_EVENT_FILTER_INVALID: Self

Event filter invalid.

Source

pub const BAD_CONTENT_FILTER_INVALID: Self

Content filter invalid.

Source

pub const BAD_SUBSCRIPTION_ID_INVALID: Self

Subscription ID invalid.

Source

pub const BAD_SEQUENCE_NUMBER_UNKNOWN: Self

Sequence number unknown.

Source

pub const BAD_MESSAGE_NOT_AVAILABLE: Self

Message not available.

Source

pub const BAD_INSUFFICIENT_CLIENT_PROFILE: Self

Insufficient client profile.

Source

pub const BAD_SESSION_ID_INVALID: Self

Session ID invalid.

Source

pub const BAD_SESSION_CLOSED: Self

Session closed.

Source

pub const BAD_SESSION_NOT_ACTIVATED: Self

Session not activated.

Source

pub const BAD_SECURE_CHANNEL_ID_INVALID: Self

Secure channel ID invalid.

Source

pub const BAD_SECURE_CHANNEL_CLOSED: Self

Secure channel closed.

Source

pub const BAD_REQUEST_TIMEOUT: Self

Request timeout.

Source

pub const BAD_SECURITY_CHECKS_FAILED: Self

Security checks failed.

Source

pub const BAD_USER_ACCESS_DENIED: Self

User access denied.

Source

pub const BAD_IDENTITY_TOKEN_INVALID: Self

Identity token invalid.

Source

pub const BAD_IDENTITY_TOKEN_REJECTED: Self

Identity token rejected.

Source

pub const BAD_NO_MATCH: Self

No match.

Source

pub const BAD_BROWSE_DIRECTION_INVALID: Self

Browse direction invalid.

Source

pub const BAD_NODE_NOT_BROWSABLE: Self

Node not browsable.

Source

pub const BAD_REFERENCE_TYPE_ID_INVALID: Self

Reference type ID invalid.

Source

pub const BAD_CONTINUATION_POINT_INVALID: Self

Continuation point invalid.

Source

pub const BAD_NO_CONTINUATION_POINTS: Self

No continuation points.

Source

pub const BAD_TOO_MANY_SUBSCRIPTIONS: Self

Too many subscriptions.

Source

pub const BAD_TOO_MANY_MONITORED_ITEMS: Self

Too many monitored items.

Source

pub const BAD_WRITE_NOT_SUPPORTED: Self

Write not supported.

Source

pub const BAD_HISTORY_OPERATION_INVALID: Self

History operation invalid.

Source

pub const BAD_HISTORY_OPERATION_UNSUPPORTED: Self

History operation unsupported.

Source

pub const fn from_raw(value: u32) -> Self

Create a status code from a raw value.

Source

pub const fn raw(&self) -> u32

Get the raw value.

Source

pub const fn is_good(&self) -> bool

Check if the status is good.

Source

pub const fn is_uncertain(&self) -> bool

Check if the status is uncertain.

Source

pub const fn is_bad(&self) -> bool

Check if the status is bad.

Source

pub const fn severity(&self) -> u8

Get the severity (0=Good, 1=Uncertain, 2=Bad).

Source

pub const fn sub_code(&self) -> u16

Get the sub-code.

Source

pub const fn info_bits(&self) -> u16

Get the info bits.

Source

pub fn description(&self) -> &'static str

Get a description of this status code.

Trait Implementations§

Source§

impl BinaryDecodable for StatusCode

Source§

fn decode(buf: &mut Bytes) -> OpcUaResult<Self>

Decode this value from the buffer, advancing the cursor.
Source§

impl BinaryEncodable for StatusCode

Source§

fn encode(&self, buf: &mut BytesMut) -> OpcUaResult<()>

Encode this value into the buffer.
Source§

fn encoded_size(&self) -> usize

Return the encoded byte size of this value.
Source§

impl Clone for StatusCode

Source§

fn clone(&self) -> StatusCode

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 StatusCode

Source§

impl Debug for StatusCode

Source§

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

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

impl Default for StatusCode

Source§

fn default() -> Self

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

impl<'de> Deserialize<'de> for StatusCode

Source§

fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>
where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
Source§

impl Display for StatusCode

Source§

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

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

impl Eq for StatusCode

Source§

impl From<StatusCode> for u32

Source§

fn from(status: StatusCode) -> Self

Converts to this type from the input type.
Source§

impl From<u32> for StatusCode

Source§

fn from(value: u32) -> Self

Converts to this type from the input type.
Source§

impl Hash for StatusCode

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 PartialEq for StatusCode

Source§

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

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

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

Inequality operator !=. Read more
Source§

impl Serialize for StatusCode

Source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more
Source§

impl StructuralPartialEq for StatusCode

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> 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> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,

Source§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

Source§

fn equivalent(&self, key: &K) -> bool

Checks if this value is equivalent to the given key. Read more
Source§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

Source§

fn equivalent(&self, key: &K) -> bool

Checks if this value is equivalent to the given key. Read more
Source§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

Source§

fn equivalent(&self, key: &K) -> bool

Compare self to key and return true if they are equal.
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
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> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self>

Converts self into a Left variant of Either<Self, Self> if into_left is true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

Converts self into a Left variant of Either<Self, Self> if into_left(&self) returns true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

impl<T> Pointable for T

Source§

const ALIGN: usize

The alignment of pointer.
Source§

type Init = T

The type for initializers.
Source§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
Source§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
Source§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
Source§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
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 = 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

Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more