Enum opcua_types::variant::Variant[][src]

pub enum Variant {
Show 24 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>), Guid(Box<Guid>), StatusCode(StatusCode), ByteString(ByteString), XmlElement(XmlElement), QualifiedName(Box<QualifiedName>), LocalizedText(Box<LocalizedText>), NodeId(Box<NodeId>), ExpandedNodeId(Box<ExpandedNodeId>), ExtensionObject(Box<ExtensionObject>), Array(Box<Array>),
}
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

Boolean

Tuple Fields of Boolean

0: bool
SByte

Signed byte

Tuple Fields of SByte

0: i8
Byte

Unsigned byte

Tuple Fields of Byte

0: u8
Int16

Signed 16-bit int

Tuple Fields of Int16

0: i16
UInt16

Unsigned 16-bit int

Tuple Fields of UInt16

0: u16
Int32

Signed 32-bit int

Tuple Fields of Int32

0: i32
UInt32

Unsigned 32-bit int

Tuple Fields of UInt32

0: u32
Int64

Signed 64-bit int

Tuple Fields of Int64

0: i64
UInt64

Unsigned 64-bit int

Tuple Fields of UInt64

0: u64
Float

Float

Tuple Fields of Float

0: f32
Double

Double

Tuple Fields of Double

0: f64
String

String

Tuple Fields of String

0: UAString
DateTime

DateTime

Tuple Fields of DateTime

0: Box<DateTime>
Guid

Guid

Tuple Fields of Guid

0: Box<Guid>
StatusCode

StatusCode

Tuple Fields of StatusCode

0: StatusCode
ByteString

ByteString

Tuple Fields of ByteString

0: ByteString
XmlElement

XmlElement

Tuple Fields of XmlElement

0: XmlElement
QualifiedName

QualifiedName

Tuple Fields of QualifiedName

0: Box<QualifiedName>
LocalizedText

LocalizedText

Tuple Fields of LocalizedText

0: Box<LocalizedText>
NodeId

NodeId

Tuple Fields of NodeId

0: Box<NodeId>
ExpandedNodeId

ExpandedNodeId

Tuple Fields of ExpandedNodeId

0: Box<ExpandedNodeId>
ExtensionObject

ExtensionObject

Tuple Fields of ExtensionObject

0: Box<ExtensionObject>
Array

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

Tuple Fields of Array

0: Box<Array>

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

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

Performs the conversion.

Performs the conversion.

Performs the conversion.

Performs the conversion.

Performs the conversion.

Performs the conversion.

Performs the conversion.

Performs the conversion.

Performs the conversion.

Performs the conversion.

Performs the conversion.

Performs the conversion.

Performs the conversion.

Performs the conversion.

Performs the conversion.

Performs the conversion.

Performs the conversion.

Performs the conversion.

Performs the conversion.

Performs the conversion.

Performs the conversion.

Performs the conversion.

Performs the conversion.

Performs the conversion.

Performs the conversion.

Performs the conversion.

Performs the conversion.

Performs the conversion.

Performs the conversion.

Performs the conversion.

Performs the conversion.

Performs the conversion.

Performs the conversion.

Performs the conversion.

Performs the conversion.

Performs the conversion.

Performs the conversion.

Performs the conversion.

Performs the conversion.

Performs the conversion.

Performs the conversion.

Performs the conversion.

Performs the conversion.

Performs the conversion.

Performs the conversion.

Performs the conversion.

Performs the conversion.

Performs the conversion.

Performs the conversion.

Performs the conversion.

Performs the conversion.

Performs the conversion.

Performs the conversion.

Performs the conversion.

Performs the conversion.

Performs the conversion.

Performs the conversion.

Performs the conversion.

Performs the conversion.

Performs the conversion.

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.

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

Performs the conversion.

Performs the conversion.

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)

recently added

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.