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 type has no value. It is equivalent to a Null value (part 6 5.1.6)
Boolean
Tuple Fields of Boolean
0: boolSigned byte
Tuple Fields of SByte
0: i8Unsigned byte
Tuple Fields of Byte
0: u8Signed 16-bit int
Tuple Fields of Int16
0: i16Unsigned 16-bit int
Tuple Fields of UInt16
0: u16Signed 32-bit int
Tuple Fields of Int32
0: i32Unsigned 32-bit int
Tuple Fields of UInt32
0: u32Signed 64-bit int
Tuple Fields of Int64
0: i64Unsigned 64-bit int
Tuple Fields of UInt64
0: u64Float
Tuple Fields of Float
0: f32Double
Tuple Fields of Double
0: f64String
Tuple Fields of String
0: UAStringDateTime
Guid
StatusCode
Tuple Fields of StatusCode
0: StatusCodeByteString
Tuple Fields of ByteString
0: ByteStringXmlElement
Tuple Fields of XmlElement
0: XmlElementQualifiedName
Tuple Fields of QualifiedName
0: Box<QualifiedName>LocalizedText
Tuple Fields of LocalizedText
0: Box<LocalizedText>NodeId
ExpandedNodeId
Tuple Fields of ExpandedNodeId
0: Box<ExpandedNodeId>ExtensionObject
Tuple Fields of ExtensionObject
0: Box<ExtensionObject>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
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.
This function is for a special edge case of converting a byte string to a single array of bytes
pub fn set_range_of(
&mut self,
range: NumericRange,
other: &Variant
) -> Result<(), StatusCode>
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
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error> where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error> where
__D: Deserializer<'de>,
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.
Performs the conversion.
Performs the conversion.
Performs the conversion.
Performs the conversion.
Performs the conversion.
Performs the conversion.
Auto Trait Implementations
impl RefUnwindSafe for Variant
impl UnwindSafe for Variant
Blanket Implementations
Mutably borrows from an owned value. Read more