pub enum Variant {
Show 26 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(DateTime), Guid(Guid), 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>), DataValue(Box<DataValue, Global>), Array(Vec<Variant, Global>), MultiDimensionArray(Box<MultiDimensionArray, Global>),
}
Expand description

A Variant holds all other OPC UA 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

§

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(DateTime)

DateTime

§

Guid(Guid)

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

§

DataValue(Box<DataValue, Global>)

DataValue (boxed because a DataValue itself holds a Variant)

§

Array(Vec<Variant, Global>)

Single dimension array A variant can be an array of other kinds (all of which must be the same type), second argument is the dimensions of the array which should match the array length, otherwise BadDecodingError

§

MultiDimensionArray(Box<MultiDimensionArray, Global>)

Multi dimension array A variant can be an array of other kinds (all of which must be the same type), second argument is the dimensions of the array which should match the array length, otherwise BadDecodingError Higher rank dimensions are serialized first. For example an array with dimensions [2,2,2] is written in this order: [0,0,0], [0,0,1], [0,1,0], [0,1,1], [1,0,0], [1,0,1], [1,1,0], [1,1,1]

Implementations§

Test the flag (convenience method)

Tests and returns true if the variant holds a numeric type

Test if the variant holds an array

Tests and returns true if the variant is an array containing numeric values

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

Returns an array of UInt32s

Trait Implementations§

Returns the byte length of the structure. This calculation should be exact and as efficient as possible. Read more
Encodes the instance to the write stream.
Decodes an instance from the read stream. The decoding limits are 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
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 !=. The default implementation is almost always sufficient, and should not be overridden without very good reason. Read more
Serialize this value into the given Serde serializer. Read more

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

Converts the given value to a String. Read more

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