pub struct Nc4File {
pub root: Nc4Group,
pub global_attributes: Vec<(String, String)>,
pub dimensions: Vec<(String, Option<usize>)>,
pub unlimited_size: usize,
}Expand description
A NetCDF-4 (HDF5-based) in-memory dataset with group support.
Fields§
§root: Nc4GroupRoot group (equivalent to “/” in HDF5).
global_attributes: Vec<(String, String)>Global (file-level) attributes.
dimensions: Vec<(String, Option<usize>)>All dimensions (name → size, None = unlimited).
unlimited_size: usizeCurrent size of the unlimited dimension (number of records written).
Implementations§
Source§impl Nc4File
impl Nc4File
Sourcepub fn add_dimension(&mut self, name: &str, size: usize)
pub fn add_dimension(&mut self, name: &str, size: usize)
Add a fixed dimension.
Sourcepub fn add_unlimited_dimension(&mut self, name: &str)
pub fn add_unlimited_dimension(&mut self, name: &str)
Add an unlimited dimension.
Sourcepub fn extend_unlimited(&mut self)
pub fn extend_unlimited(&mut self)
Extend the unlimited dimension by one record.
Sourcepub fn add_global_attribute(&mut self, key: &str, value: &str)
pub fn add_global_attribute(&mut self, key: &str, value: &str)
Add a global attribute.
Sourcepub fn get_global_attribute(&self, key: &str) -> Option<&str>
pub fn get_global_attribute(&self, key: &str) -> Option<&str>
Get a global attribute.
Sourcepub fn get_dimension_size(&self, name: &str) -> Option<usize>
pub fn get_dimension_size(&self, name: &str) -> Option<usize>
Get a dimension size.
Sourcepub fn is_unlimited(&self, name: &str) -> bool
pub fn is_unlimited(&self, name: &str) -> bool
Whether a dimension is unlimited.
Sourcepub fn add_variable(&mut self, var: Nc4Variable)
pub fn add_variable(&mut self, var: Nc4Variable)
Add a variable to the root group.
Sourcepub fn get_variable(&self, name: &str) -> Option<&Nc4Variable>
pub fn get_variable(&self, name: &str) -> Option<&Nc4Variable>
Get a variable from the root group.
Sourcepub fn get_group(&self, name: &str) -> Option<&Nc4Group>
pub fn get_group(&self, name: &str) -> Option<&Nc4Group>
Get a sub-group by name from the root.
Sourcepub fn total_variable_count(&self) -> usize
pub fn total_variable_count(&self) -> usize
All variable count (all groups).
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Nc4File
impl RefUnwindSafe for Nc4File
impl Send for Nc4File
impl Sync for Nc4File
impl Unpin for Nc4File
impl UnsafeUnpin for Nc4File
impl UnwindSafe for Nc4File
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.