pub struct DataSet { /* private fields */ }Expand description
A column-oriented table value (the DataSet datatype).
Construct via DataSet::new, which validates that columns, types, and
every row share the same width (tck-id-payloads-dataset-*).
Implementations§
Source§impl DataSet
impl DataSet
Sourcepub fn new(
columns: Vec<String>,
types: Vec<DataType>,
rows: Vec<Vec<DataSetValue>>,
) -> Result<Self>
pub fn new( columns: Vec<String>, types: Vec<DataType>, rows: Vec<Vec<DataSetValue>>, ) -> Result<Self>
Build and validate a DataSet.
§Errors
Returns SparkplugError::DataSetShape if columns.len() != types.len(),
any column type is not a basic scalar, or any row’s width differs from
the column count.
Sourcepub fn num_of_columns(&self) -> u64
pub fn num_of_columns(&self) -> u64
The number of columns (num_of_columns on the wire).
Sourcepub fn rows(&self) -> &[Vec<DataSetValue>]
pub fn rows(&self) -> &[Vec<DataSetValue>]
The rows (each row has one DataSetValue per column).
Trait Implementations§
impl StructuralPartialEq for DataSet
Auto Trait Implementations§
impl Freeze for DataSet
impl RefUnwindSafe for DataSet
impl Send for DataSet
impl Sync for DataSet
impl Unpin for DataSet
impl UnsafeUnpin for DataSet
impl UnwindSafe for DataSet
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more