pub enum DataRecord {
Scalar(f64),
Vector(Vec<f64>),
Matrix(Vec<Vec<f64>>),
Text(String),
}Expand description
The payload carried by a single named record in a ScirsDataFile.
§Tags (on-disk)
| Variant | Tag byte |
|---|---|
| Scalar | 0 |
| Vector | 1 |
| Matrix | 2 |
| Text | 3 |
Variants§
Scalar(f64)
A single 64-bit float.
Vector(Vec<f64>)
A one-dimensional array of 64-bit floats.
Matrix(Vec<Vec<f64>>)
A two-dimensional matrix stored in row-major order.
Text(String)
A UTF-8 text string.
Implementations§
Source§impl DataRecord
impl DataRecord
Sourcepub fn named(
name: impl Into<String>,
record: DataRecord,
) -> (String, DataRecord)
pub fn named( name: impl Into<String>, record: DataRecord, ) -> (String, DataRecord)
Convenience constructor to bundle a name with a DataRecord for use
with write_scirs / read_scirs.
use scirs2_io::binary_format::DataRecord;
let entry = DataRecord::named("x", DataRecord::Scalar(1.0));
assert_eq!(entry.0, "x");Trait Implementations§
Source§impl Clone for DataRecord
impl Clone for DataRecord
Source§fn clone(&self) -> DataRecord
fn clone(&self) -> DataRecord
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for DataRecord
impl Debug for DataRecord
Source§impl PartialEq for DataRecord
impl PartialEq for DataRecord
impl StructuralPartialEq for DataRecord
Auto Trait Implementations§
impl Freeze for DataRecord
impl RefUnwindSafe for DataRecord
impl Send for DataRecord
impl Sync for DataRecord
impl Unpin for DataRecord
impl UnsafeUnpin for DataRecord
impl UnwindSafe for DataRecord
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
Source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
Wrap the input message
T in a tonic::RequestSource§impl<T> Pointable for T
impl<T> Pointable for T
Source§impl<T> PolicyExt for Twhere
T: ?Sized,
impl<T> PolicyExt for Twhere
T: ?Sized,
Source§impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
Source§fn to_subset(&self) -> Option<SS>
fn to_subset(&self) -> Option<SS>
The inverse inclusion map: attempts to construct
self from the equivalent element of its
superset. Read moreSource§fn is_in_subset(&self) -> bool
fn is_in_subset(&self) -> bool
Checks if
self is actually part of its subset T (and can be converted to it).Source§fn to_subset_unchecked(&self) -> SS
fn to_subset_unchecked(&self) -> SS
Use with care! Same as
self.to_subset but without any property checks. Always succeeds.Source§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
The inclusion map: converts
self to the equivalent element of its superset.