Struct opcua_server::prelude::Array
source · [−]pub struct Array {
pub value_type: VariantTypeId,
pub values: Vec<Variant, Global>,
pub dimensions: Vec<u32, Global>,
}
Expand description
An array is a vector of values with an optional number of dimensions. It is expected that the multi-dimensional array is valid, or it might not be encoded or decoded properly. The dimensions should match the number of values, or the array is invalid.
Fields
value_type: VariantTypeId
values: Vec<Variant, Global>
Values are stored sequentially
dimensions: Vec<u32, Global>
Multi dimension array which can contain any scalar type, all the same type. Nested arrays are rejected. 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
sourceimpl Array
impl Array
pub fn new_single<V>(
value_type: VariantTypeId,
values: V
) -> Result<Array, StatusCode> where
V: Into<Vec<Variant, Global>>,
pub fn new_multi<V, D>(
value_type: VariantTypeId,
values: V,
dimensions: D
) -> Result<Array, StatusCode> where
V: Into<Vec<Variant, Global>>,
D: Into<Vec<u32, Global>>,
pub fn is_valid(&self) -> bool
pub fn has_dimensions(&self) -> bool
pub fn encoding_mask(&self) -> u8
Trait Implementations
sourceimpl<'de> Deserialize<'de> for Array
impl<'de> Deserialize<'de> for Array
sourcefn deserialize<__D>(
__deserializer: __D
) -> Result<Array, <__D as Deserializer<'de>>::Error> where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D
) -> Result<Array, <__D as Deserializer<'de>>::Error> where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
sourceimpl Serialize for Array
impl Serialize for Array
sourcefn serialize<__S>(
&self,
__serializer: __S
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error> where
__S: Serializer,
fn serialize<__S>(
&self,
__serializer: __S
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error> where
__S: Serializer,
Serialize this value into the given Serde serializer. Read more
impl StructuralPartialEq for Array
Auto Trait Implementations
impl RefUnwindSafe for Array
impl Send for Array
impl Sync for Array
impl Unpin for Array
impl UnwindSafe for Array
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<T> ToOwned for T where
T: Clone,
impl<T> ToOwned for T where
T: Clone,
type Owned = T
type Owned = T
The resulting type after obtaining ownership.
sourcefn clone_into(&self, target: &mut T)
fn clone_into(&self, target: &mut T)
toowned_clone_into
)Uses borrowed data to replace owned data, usually by cloning. Read more