pub struct NormalizedPack {
pub records: Vec<NormalizedRecord>,
pub version: Option<i32>,
}Expand description
A normalized SenML pack where all base values have been resolved into individual records
Fields§
§records: Vec<NormalizedRecord>All records in resolved form (no base values except bver)
version: Option<i32>Version information (only base value preserved)
Implementations§
Source§impl NormalizedPack
impl NormalizedPack
Sourcepub fn to_pack(&self) -> SenMLPack
pub fn to_pack(&self) -> SenMLPack
Convert back to a SenML pack (may not preserve original base structure)
Sourcepub fn records_matching(&self, pattern: &str) -> Vec<&NormalizedRecord>
pub fn records_matching(&self, pattern: &str) -> Vec<&NormalizedRecord>
Get all records with a specific name pattern
Sourcepub fn records_in_time_range(
&self,
start: f64,
end: f64,
) -> Vec<&NormalizedRecord>
pub fn records_in_time_range( &self, start: f64, end: f64, ) -> Vec<&NormalizedRecord>
Get all records within a time range
Sourcepub fn time_range(&self) -> Option<(f64, f64)>
pub fn time_range(&self) -> Option<(f64, f64)>
Get the time range of this pack
Sourcepub fn group_by_prefix(&self) -> HashMap<String, Vec<&NormalizedRecord>>
pub fn group_by_prefix(&self) -> HashMap<String, Vec<&NormalizedRecord>>
Group records by name prefix
Trait Implementations§
Source§impl Clone for NormalizedPack
impl Clone for NormalizedPack
Source§fn clone(&self) -> NormalizedPack
fn clone(&self) -> NormalizedPack
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 NormalizedPack
impl Debug for NormalizedPack
Source§impl<'de> Deserialize<'de> for NormalizedPack
impl<'de> Deserialize<'de> for NormalizedPack
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 NormalizedPack
impl PartialEq for NormalizedPack
Source§impl Serialize for NormalizedPack
impl Serialize for NormalizedPack
impl StructuralPartialEq for NormalizedPack
Auto Trait Implementations§
impl Freeze for NormalizedPack
impl RefUnwindSafe for NormalizedPack
impl Send for NormalizedPack
impl Sync for NormalizedPack
impl Unpin for NormalizedPack
impl UnsafeUnpin for NormalizedPack
impl UnwindSafe for NormalizedPack
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