Enum opcua_types::Variant
[−]
[src]
pub enum Variant { Empty, Boolean(Boolean), SByte(SByte), Byte(Byte), Int16(Int16), UInt16(UInt16), Int32(Int32), UInt32(UInt32), Int64(Int64), UInt64(UInt64), Float(Float), Double(Double), String(UAString), DateTime(DateTime), Guid(Guid), StatusCode(StatusCode), ByteString(ByteString), XmlElement(XmlElement), QualifiedName(Box<QualifiedName>), LocalizedText(Box<LocalizedText>), NodeId(Box<NodeId>), ExpandedNodeId(Box<ExpandedNodeId>), ExtensionObject(Box<ExtensionObject>), DataValue(Box<DataValue>), Array(Box<Vec<Variant>>), MultiDimensionArray(Box<MultiDimensionArray>), }
A Variant holds all primitive types, including single and multi dimensional arrays and data values. Boxes are used for more complex types to keep the size of this enum down a bit.
Variants
Empty
Empty type has no value
Boolean(Boolean)
Boolean
SByte(SByte)
Signed byte
Byte(Byte)
Unsigned byte
Int16(Int16)
Signed 16-bit int
UInt16(UInt16)
Unsigned 16-bit int
Int32(Int32)
Signed 32-bit int
UInt32(UInt32)
Unsigned 32-bit int
Int64(Int64)
Signed 64-bit int
UInt64(UInt64)
Unsigned 64-bit int
Float(Float)
Float
Double(Double)
Double
String(UAString)
String
DateTime(DateTime)
DateTime
Guid(Guid)
Guid
StatusCode(StatusCode)
StatusCode
ByteString(ByteString)
ByteString
XmlElement(XmlElement)
XmlElement
QualifiedName(Box<QualifiedName>)
QualifiedName
LocalizedText(Box<LocalizedText>)
LocalizedText
NodeId(Box<NodeId>)
NodeId
ExpandedNodeId(Box<ExpandedNodeId>)
ExpandedNodeId
ExtensionObject(Box<ExtensionObject>)
ExtensionObject
DataValue(Box<DataValue>)
DataValue (boxed because a DataValue itself holds a Variant)
Array(Box<Vec<Variant>>)
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 BAD_DECODING_ERROR
MultiDimensionArray(Box<MultiDimensionArray>)
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 BAD_DECODING_ERROR 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]
Methods
impl Variant
[src]
fn new_node_id(node_id: NodeId) -> Variant
fn new_expanded_node_id(expanded_node_id: ExpandedNodeId) -> Variant
fn new_qualified_name(qualified_name: QualifiedName) -> Variant
fn new_localized_text(localized_text: LocalizedText) -> Variant
fn new_extension_object(extension_object: ExtensionObject) -> Variant
fn test_encoding_flag(encoding_mask: u8, data_type_id: DataTypeId) -> bool
Test the flag (convenience method)
fn new_multi_dimension_array(
values: Vec<Variant>,
dimensions: Vec<Int32>
) -> Variant
values: Vec<Variant>,
dimensions: Vec<Int32>
) -> Variant
fn new_i32_array(in_values: &[Int32]) -> Variant
fn new_string_array(in_values: &[String]) -> Variant
fn is_numeric(&self) -> bool
Tests and returns true if the variant holds a numeric type
fn as_f64(&self) -> Option<f64>
Converts the numeric type to a double or returns None
Trait Implementations
impl PartialEq for Variant
[src]
fn eq(&self, __arg_0: &Variant) -> bool
This method tests for self
and other
values to be equal, and is used by ==
. Read more
fn ne(&self, __arg_0: &Variant) -> bool
This method tests for !=
.
impl Debug for Variant
[src]
impl Clone for Variant
[src]
fn clone(&self) -> Variant
Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)
1.0.0
Performs copy-assignment from source
. Read more
impl BinaryEncoder<Variant> for Variant
[src]
fn byte_len(&self) -> usize
Returns the byte length of the structure. This calculation should be exact and as efficient as possible. Read more
fn encode<S: Write>(&self, stream: &mut S) -> EncodingResult<usize>
Encodes the instance to the write stream.
fn decode<S: Read>(stream: &mut S) -> EncodingResult<Self>
Decodes an instance from the read stream.