pub struct NetCdfFile {
pub dimensions: Vec<(String, usize)>,
pub variables: Vec<NetCdfVariable>,
pub attributes: Vec<(String, String)>,
pub unlimited_dim: Option<String>,
}Expand description
An in-memory representation of a NetCDF-like dataset.
Fields§
§dimensions: Vec<(String, usize)>Named dimensions and their sizes.
variables: Vec<NetCdfVariable>Variables stored in the file.
attributes: Vec<(String, String)>Global attributes as key-value string pairs.
unlimited_dim: Option<String>Unlimited dimension name, if any.
Implementations§
Source§impl NetCdfFile
impl NetCdfFile
Sourcepub fn add_dimension(&mut self, name: &str, size: usize)
pub fn add_dimension(&mut self, name: &str, size: usize)
Add a dimension.
Sourcepub fn add_unlimited_dimension(&mut self, name: &str, current_size: usize)
pub fn add_unlimited_dimension(&mut self, name: &str, current_size: usize)
Add an unlimited dimension.
Sourcepub fn add_variable(&mut self, var: NetCdfVariable)
pub fn add_variable(&mut self, var: NetCdfVariable)
Add a variable.
Sourcepub fn add_attribute(&mut self, key: &str, value: &str)
pub fn add_attribute(&mut self, key: &str, value: &str)
Add a global attribute.
Sourcepub fn get_variable(&self, name: &str) -> Option<&NetCdfVariable>
pub fn get_variable(&self, name: &str) -> Option<&NetCdfVariable>
Get a variable by name.
Sourcepub fn get_variable_mut(&mut self, name: &str) -> Option<&mut NetCdfVariable>
pub fn get_variable_mut(&mut self, name: &str) -> Option<&mut NetCdfVariable>
Get a mutable variable by name.
Sourcepub fn get_attribute(&self, key: &str) -> Option<&str>
pub fn get_attribute(&self, key: &str) -> Option<&str>
Get a global attribute value by key.
Sourcepub fn get_dimension_size(&self, name: &str) -> Option<usize>
pub fn get_dimension_size(&self, name: &str) -> Option<usize>
Get the size of a dimension by name.
Sourcepub fn is_unlimited_dimension(&self, name: &str) -> bool
pub fn is_unlimited_dimension(&self, name: &str) -> bool
Check if a dimension is unlimited.
Sourcepub fn variable_names(&self) -> Vec<&str>
pub fn variable_names(&self) -> Vec<&str>
List all variable names.
Sourcepub fn dimension_names(&self) -> Vec<&str>
pub fn dimension_names(&self) -> Vec<&str>
List all dimension names.
Trait Implementations§
Source§impl Clone for NetCdfFile
impl Clone for NetCdfFile
Source§fn clone(&self) -> NetCdfFile
fn clone(&self) -> NetCdfFile
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 NetCdfFile
impl Debug for NetCdfFile
Auto Trait Implementations§
impl Freeze for NetCdfFile
impl RefUnwindSafe for NetCdfFile
impl Send for NetCdfFile
impl Sync for NetCdfFile
impl Unpin for NetCdfFile
impl UnsafeUnpin for NetCdfFile
impl UnwindSafe for NetCdfFile
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.