pub enum Variant {
Show 27 variants Empty, Boolean(bool), SByte(i8), Byte(u8), Int16(i16), UInt16(u16), Int32(i32), UInt32(u32), Int64(i64), UInt64(u64), Float(f32), Double(f64), String(UAString), DateTime(Box<DateTime, Global>), Guid(Box<Guid, Global>), StatusCode(StatusCode), ByteString(ByteString), XmlElement(UAString), QualifiedName(Box<QualifiedName, Global>), LocalizedText(Box<LocalizedText, Global>), NodeId(Box<NodeId, Global>), ExpandedNodeId(Box<ExpandedNodeId, Global>), ExtensionObject(Box<ExtensionObject, Global>), Variant(Box<Variant, Global>), DataValue(Box<DataValue, Global>), Diagnostics(Box<DiagnosticInfo, Global>), Array(Box<Array, Global>),
}
Expand description

A Variant holds built-in OPC UA data types, including single and multi dimensional arrays, data values and extension objects.

As variants may be passed around a lot on the stack, Boxes are used for more complex types to keep the size of this type down a bit, especially when used in arrays.

Variants

Empty

Empty type has no value. It is equivalent to a Null value (part 6 5.1.6)

Boolean(bool)

Boolean

SByte(i8)

Signed byte

Byte(u8)

Unsigned byte

Int16(i16)

Signed 16-bit int

UInt16(u16)

Unsigned 16-bit int

Int32(i32)

Signed 32-bit int

UInt32(u32)

Unsigned 32-bit int

Int64(i64)

Signed 64-bit int

UInt64(u64)

Unsigned 64-bit int

Float(f32)

Float

Double(f64)

Double

String(UAString)

String

DateTime(Box<DateTime, Global>)

DateTime

Guid(Box<Guid, Global>)

Guid

StatusCode(StatusCode)

StatusCode

ByteString(ByteString)

ByteString

XmlElement(UAString)

XmlElement

QualifiedName(Box<QualifiedName, Global>)

QualifiedName

LocalizedText(Box<LocalizedText, Global>)

LocalizedText

NodeId(Box<NodeId, Global>)

NodeId

ExpandedNodeId(Box<ExpandedNodeId, Global>)

ExpandedNodeId

ExtensionObject(Box<ExtensionObject, Global>)

ExtensionObject

Variant(Box<Variant, Global>)

DataValue(Box<DataValue, Global>)

Diagnostics(Box<DiagnosticInfo, Global>)

Array(Box<Array, Global>)

Single dimension array which can contain any scalar type, all the same type. Nested arrays will be rejected.

Implementations

Test the flag (convenience method)

Performs an EXPLICIT cast from one type to another. This will first attempt an implicit conversion and only then attempt to cast. Casting is potentially lossy.

Performs an IMPLICIT conversion from one type to another

Tests and returns true if the variant holds a numeric type

Test if the variant holds an array

Tests that the variant is in a valid state. In particular for arrays ensuring that the values are all acceptable and for a multi dimensional array that the dimensions equal the actual values.

Converts the numeric type to a double or returns None

This function is for a special edge case of converting a byte string to a single array of bytes

This function gets a range of values from the variant if it is an array, or returns a clone of the variant itself.

Trait Implementations

Returns the exact byte length of the structure as it would be if encode were called. This may be called prior to writing to ensure the correct amount of space is available. Read more

Encodes the instance to the write stream.

Decodes an instance from the read stream. The decoding options contains restrictions set by the server / client on the length of strings, arrays etc. If these limits are exceeded the implementation should return with a BadDecodingError as soon as possible. Read more

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

Formats the value using the given formatter. Read more

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

Deserialize this value from the given Serde deserializer. Read more

This implementation is mainly for debugging / convenience purposes, to eliminate some of the noise in common types from using the Debug trait.

Formats the value using the given formatter. Read more

Converts to this type from the input type.

Converts to this type from the input type.

Converts to this type from the input type.

Converts to this type from the input type.

Converts to this type from the input type.

Converts to this type from the input type.

Converts to this type from the input type.

Converts to this type from the input type.

Converts to this type from the input type.

Converts to this type from the input type.

Converts to this type from the input type.

Converts to this type from the input type.

Converts to this type from the input type.

Converts to this type from the input type.

Converts to this type from the input type.

Converts to this type from the input type.

Converts to this type from the input type.

Converts to this type from the input type.

Converts to this type from the input type.

Converts to this type from the input type.

Converts to this type from the input type.

Converts to this type from the input type.

Converts to this type from the input type.

Converts to this type from the input type.

Converts to this type from the input type.

Converts to this type from the input type.

Converts to this type from the input type.

Converts to this type from the input type.

Converts to this type from the input type.

Converts to this type from the input type.

Converts to this type from the input type.

Converts to this type from the input type.

Converts to this type from the input type.

Converts to this type from the input type.

Converts to this type from the input type.

Converts to this type from the input type.

Converts to this type from the input type.

Converts to this type from the input type.

Converts to this type from the input type.

Converts to this type from the input type.

Converts to this type from the input type.

Converts to this type from the input type.

Converts to this type from the input type.

Converts to this type from the input type.

Converts to this type from the input type.

Converts to this type from the input type.

Converts to this type from the input type.

Converts to this type from the input type.

Converts to this type from the input type.

Converts to this type from the input type.

Converts to this type from the input type.

Converts to this type from the input type.

Converts to this type from the input type.

Converts to this type from the input type.

Converts to this type from the input type.

Converts to this type from the input type.

Converts to this type from the input type.

Converts to this type from the input type.

Converts to this type from the input type.

Converts to this type from the input type.

Converts to this type from the input type.

Converts to this type from the input type.

Converts to this type from the input type.

Converts to this type from the input type.

Converts to this type from the input type.

Converts to this type from the input type.

Converts to this type from the input type.

Converts to this type from the input type.

This method tests for self and other values to be equal, and is used by ==. Read more

This method tests for !=.

Serialize this value into the given Serde serializer. Read more

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

The resulting type after obtaining ownership.

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

🔬 This is a nightly-only experimental API. (toowned_clone_into)

Uses borrowed data to replace owned data, usually by cloning. Read more

Converts the given value to a String. Read more

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.