pub struct Variable { /* private fields */ }Expand description
A variable in a NetCDF file.
Implementations§
Source§impl Variable
impl Variable
Sourcepub fn new(
name: impl Into<String>,
data_type: DataType,
dimension_names: Vec<String>,
) -> Result<Self>
pub fn new( name: impl Into<String>, data_type: DataType, dimension_names: Vec<String>, ) -> Result<Self>
Sourcepub fn dimension_names(&self) -> &[String]
pub fn dimension_names(&self) -> &[String]
Get the dimension names.
Sourcepub const fn is_coordinate(&self) -> bool
pub const fn is_coordinate(&self) -> bool
Check if this is a coordinate variable.
Sourcepub fn set_coordinate(&mut self, is_coordinate: bool)
pub fn set_coordinate(&mut self, is_coordinate: bool)
Set whether this is a coordinate variable.
Sourcepub const fn attributes(&self) -> &Attributes
pub const fn attributes(&self) -> &Attributes
Get the attributes.
Sourcepub fn attributes_mut(&mut self) -> &mut Attributes
pub fn attributes_mut(&mut self) -> &mut Attributes
Get mutable access to attributes.
Sourcepub fn size(&self, dimensions: &Dimensions) -> Result<usize>
pub fn size(&self, dimensions: &Dimensions) -> Result<usize>
Get the total size based on dimensions.
§Errors
Returns error if any dimension is not found or if size overflows.
Sourcepub fn size_bytes(&self, dimensions: &Dimensions) -> Result<usize>
pub fn size_bytes(&self, dimensions: &Dimensions) -> Result<usize>
Get the size in bytes based on dimensions.
§Errors
Returns error if any dimension is not found or if size overflows.
Sourcepub fn is_netcdf3_compatible(&self) -> bool
pub fn is_netcdf3_compatible(&self) -> bool
Check if compatible with NetCDF-3.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Variable
impl<'de> Deserialize<'de> for Variable
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl FromIterator<Variable> for Variables
impl FromIterator<Variable> for Variables
Auto Trait Implementations§
impl Freeze for Variable
impl RefUnwindSafe for Variable
impl Send for Variable
impl Sync for Variable
impl Unpin for Variable
impl UnsafeUnpin for Variable
impl UnwindSafe for Variable
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