pub struct ShdfGroup {
pub name: String,
pub datasets: Vec<Dataset>,
pub children: Vec<ShdfGroup>,
pub attributes: Vec<(String, String)>,
}Expand description
A group in the SHDF hierarchy, containing datasets and sub-groups.
Fields§
§name: StringGroup name.
datasets: Vec<Dataset>Datasets in this group.
children: Vec<ShdfGroup>Sub-groups.
attributes: Vec<(String, String)>Group-level attributes.
Implementations§
Source§impl ShdfGroup
impl ShdfGroup
Sourcepub fn add_dataset_f64(&mut self, name: &str, shape: Vec<usize>, data: Vec<f64>)
pub fn add_dataset_f64(&mut self, name: &str, shape: Vec<usize>, data: Vec<f64>)
Add a Float64 dataset to this group.
Sourcepub fn add_dataset_i32(&mut self, name: &str, shape: Vec<usize>, data: Vec<i32>)
pub fn add_dataset_i32(&mut self, name: &str, shape: Vec<usize>, data: Vec<i32>)
Add an Int32 dataset to this group.
Sourcepub fn add_attribute(&mut self, key: &str, value: &str)
pub fn add_attribute(&mut self, key: &str, value: &str)
Add an attribute to this group.
Sourcepub fn get_dataset(&self, name: &str) -> Option<&Dataset>
pub fn get_dataset(&self, name: &str) -> Option<&Dataset>
Find a dataset by name.
Sourcepub fn total_datasets(&self) -> usize
pub fn total_datasets(&self) -> usize
Count total datasets (recursive).
Trait Implementations§
Auto Trait Implementations§
impl Freeze for ShdfGroup
impl RefUnwindSafe for ShdfGroup
impl Send for ShdfGroup
impl Sync for ShdfGroup
impl Unpin for ShdfGroup
impl UnsafeUnpin for ShdfGroup
impl UnwindSafe for ShdfGroup
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<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.