pub struct Nc4Group {
pub name: String,
pub variables: Vec<Nc4Variable>,
pub subgroups: Vec<Nc4Group>,
pub attributes: Vec<(String, String)>,
}Expand description
A named group within a NetCDF-4 file.
Groups allow hierarchical organization of variables, akin to HDF5 groups.
Fields§
§name: StringGroup name.
variables: Vec<Nc4Variable>Variables in this group.
subgroups: Vec<Nc4Group>Sub-groups.
attributes: Vec<(String, String)>Group-level attributes (inherited by sub-groups).
Implementations§
Source§impl Nc4Group
impl Nc4Group
Sourcepub fn add_variable(&mut self, var: Nc4Variable)
pub fn add_variable(&mut self, var: Nc4Variable)
Add a variable to this group.
Sourcepub fn add_subgroup(&mut self, group: Nc4Group)
pub fn add_subgroup(&mut self, group: Nc4Group)
Add a sub-group.
Sourcepub fn add_attribute(&mut self, key: &str, value: &str)
pub fn add_attribute(&mut self, key: &str, value: &str)
Add an attribute.
Sourcepub fn get_variable(&self, name: &str) -> Option<&Nc4Variable>
pub fn get_variable(&self, name: &str) -> Option<&Nc4Variable>
Get a variable by name.
Sourcepub fn get_attribute(&self, key: &str) -> Option<&str>
pub fn get_attribute(&self, key: &str) -> Option<&str>
Get attribute value.
Sourcepub fn all_variables(&self) -> Vec<&Nc4Variable>
pub fn all_variables(&self) -> Vec<&Nc4Variable>
All variables in this group and all sub-groups (depth-first).
Sourcepub fn total_variable_count(&self) -> usize
pub fn total_variable_count(&self) -> usize
Total variable count (recursive).
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Nc4Group
impl RefUnwindSafe for Nc4Group
impl Send for Nc4Group
impl Sync for Nc4Group
impl Unpin for Nc4Group
impl UnsafeUnpin for Nc4Group
impl UnwindSafe for Nc4Group
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.