pub struct Nc4Variable {
pub name: String,
pub dims: Vec<String>,
pub float_data: Vec<f64>,
pub string_data: Vec<String>,
pub int_data: Vec<i64>,
pub data_type: Nc4DataType,
pub attributes: Vec<VariableAttribute>,
}Expand description
A NetCDF-4 variable with typed storage.
Fields§
§name: StringVariable name.
dims: Vec<String>Ordered dimension names.
float_data: Vec<f64>Floating-point data (used when data_type is Float64 or Float32).
string_data: Vec<String>String data (used when data_type is String).
int_data: Vec<i64>Integer data (used when data_type is Int32 or UInt8).
data_type: Nc4DataTypeData type.
attributes: Vec<VariableAttribute>Per-variable attributes.
Implementations§
Source§impl Nc4Variable
impl Nc4Variable
Sourcepub fn float64(name: &str, dims: Vec<String>, data: Vec<f64>) -> Self
pub fn float64(name: &str, dims: Vec<String>, data: Vec<f64>) -> Self
Create a Float64 variable.
Sourcepub fn string_var(name: &str, dims: Vec<String>, data: Vec<String>) -> Self
pub fn string_var(name: &str, dims: Vec<String>, data: Vec<String>) -> Self
Create a String variable.
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_attribute(&self, key: &str) -> Option<&str>
pub fn get_attribute(&self, key: &str) -> Option<&str>
Get attribute value by key.
Trait Implementations§
Source§impl Clone for Nc4Variable
impl Clone for Nc4Variable
Source§fn clone(&self) -> Nc4Variable
fn clone(&self) -> Nc4Variable
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for Nc4Variable
impl RefUnwindSafe for Nc4Variable
impl Send for Nc4Variable
impl Sync for Nc4Variable
impl Unpin for Nc4Variable
impl UnsafeUnpin for Nc4Variable
impl UnwindSafe for Nc4Variable
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.