pub struct NetCdfWriter { /* private fields */ }Expand description
NetCDF file writer.
Provides methods for creating and writing NetCDF files.
Implementations§
Source§impl NetCdfWriter
impl NetCdfWriter
Sourcepub const fn metadata(&self) -> &NetCdfMetadata
pub const fn metadata(&self) -> &NetCdfMetadata
Get the file metadata.
Sourcepub fn add_dimension(&mut self, dimension: Dimension) -> Result<()>
pub fn add_dimension(&mut self, dimension: Dimension) -> Result<()>
Sourcepub fn add_variable(&mut self, variable: Variable) -> Result<()>
pub fn add_variable(&mut self, variable: Variable) -> Result<()>
Add a variable.
§Errors
Returns error if not in define mode, variable already exists, or variable dimensions don’t exist.
Sourcepub fn add_global_attribute(&mut self, attribute: Attribute) -> Result<()>
pub fn add_global_attribute(&mut self, attribute: Attribute) -> Result<()>
Sourcepub fn add_variable_attribute(
&mut self,
var_name: &str,
attribute: Attribute,
) -> Result<()>
pub fn add_variable_attribute( &mut self, var_name: &str, attribute: Attribute, ) -> Result<()>
Sourcepub fn end_define_mode(&mut self) -> Result<()>
pub fn end_define_mode(&mut self) -> Result<()>
End define mode and enter data mode.
After calling this, you can write data but cannot add dimensions, variables, or attributes.
§Errors
Returns error if already in data mode or if metadata is invalid.
Sourcepub fn write_f32(&mut self, var_name: &str, data: &[f32]) -> Result<()>
pub fn write_f32(&mut self, var_name: &str, data: &[f32]) -> Result<()>
Write f32 data to a variable.
§Errors
Returns error if in define mode, variable doesn’t exist, or data size doesn’t match variable size.
Sourcepub fn write_f64(&mut self, var_name: &str, data: &[f64]) -> Result<()>
pub fn write_f64(&mut self, var_name: &str, data: &[f64]) -> Result<()>
Write f64 data to a variable.
§Errors
Returns error if in define mode, variable doesn’t exist, or data size doesn’t match variable size.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for NetCdfWriter
impl RefUnwindSafe for NetCdfWriter
impl Send for NetCdfWriter
impl Sync for NetCdfWriter
impl Unpin for NetCdfWriter
impl UnsafeUnpin for NetCdfWriter
impl UnwindSafe for NetCdfWriter
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