pub struct OwnedDataRow {
pub timestamp: i64,
pub fields: HashMap<String, f64>,
}Expand description
An owned data row with generic fields
This struct provides an industry-agnostic type for storing arbitrary data rows. It uses a HashMap for field storage to support any schema.
For performance-critical paths, the JIT compiler generates optimized code when the type schema is known at compile time.
Fields§
§timestamp: i64Unix timestamp (seconds) - always present in time series data
fields: HashMap<String, f64>Generic field storage - any f64 fields
Implementations§
Source§impl OwnedDataRow
impl OwnedDataRow
Sourcepub fn new_generic(timestamp: i64, fields: HashMap<String, f64>) -> Self
pub fn new_generic(timestamp: i64, fields: HashMap<String, f64>) -> Self
Create a new generic OwnedDataRow with arbitrary fields
Sourcepub fn from_hashmap(timestamp: i64, fields: HashMap<String, f64>) -> Self
pub fn from_hashmap(timestamp: i64, fields: HashMap<String, f64>) -> Self
Create from HashMap of fields (alias for new_generic)
Sourcepub fn from_data_row(row: &DataRow<'_>) -> Option<Self>
pub fn from_data_row(row: &DataRow<'_>) -> Option<Self>
Create from a DataRow by copying all available columns
Sourcepub fn field_names(&self) -> impl Iterator<Item = &String>
pub fn field_names(&self) -> impl Iterator<Item = &String>
Get all field names
Trait Implementations§
Source§impl Clone for OwnedDataRow
impl Clone for OwnedDataRow
Source§fn clone(&self) -> OwnedDataRow
fn clone(&self) -> OwnedDataRow
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 OwnedDataRow
impl Debug for OwnedDataRow
Source§impl<'de> Deserialize<'de> for OwnedDataRow
impl<'de> Deserialize<'de> for OwnedDataRow
Source§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
Source§impl PartialEq for OwnedDataRow
impl PartialEq for OwnedDataRow
Source§impl Serialize for OwnedDataRow
impl Serialize for OwnedDataRow
impl StructuralPartialEq for OwnedDataRow
Auto Trait Implementations§
impl Freeze for OwnedDataRow
impl RefUnwindSafe for OwnedDataRow
impl Send for OwnedDataRow
impl Sync for OwnedDataRow
impl Unpin for OwnedDataRow
impl UnsafeUnpin for OwnedDataRow
impl UnwindSafe for OwnedDataRow
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 more