[−][src]Struct netcdf::file::MutableFile
Mutable access to file
Implementations
impl MutableFile
[src]
pub fn root_mut(&mut self) -> Option<GroupMut<'_>>
[src]
Mutable access to the root group
Return None if this can't be a root group
pub fn variable_mut<'f>(&'f mut self, name: &str) -> Option<VariableMut<'f>>
[src]
Get a mutable variable from the group
pub fn variables_mut(&mut self) -> impl Iterator<Item = VariableMut<'_>>
[src]
Iterate over all variables in the root group, with mutable access
Examples
Use this to get multiple writable variables
let mut file = netcdf::append("file.nc")?; let mut vars = file.variables_mut().collect::<Vec<_>>(); vars[0].put_value(1_u8, Some(&[2, 5]))?; vars[1].put_value(1_u8, Some(&[5, 2]))?;
pub fn group_mut<'f>(&'f mut self, name: &str) -> Result<Option<GroupMut<'f>>>
[src]
pub fn groups_mut<'f>(
&'f mut self
) -> Result<impl Iterator<Item = GroupMut<'f>>>
[src]
&'f mut self
) -> Result<impl Iterator<Item = GroupMut<'f>>>
pub fn add_attribute<'a, T>(
&'a mut self,
name: &str,
val: T
) -> Result<Attribute<'a>> where
T: Into<AttrValue>,
[src]
&'a mut self,
name: &str,
val: T
) -> Result<Attribute<'a>> where
T: Into<AttrValue>,
Add an attribute to the root group
pub fn add_dimension<'f>(
&'f mut self,
name: &str,
len: usize
) -> Result<Dimension<'f>>
[src]
&'f mut self,
name: &str,
len: usize
) -> Result<Dimension<'f>>
Adds a dimension with the given name and size. A size of zero gives an unlimited dimension
pub fn add_unlimited_dimension(&mut self, name: &str) -> Result<Dimension<'_>>
[src]
Adds a dimension with unbounded size
pub fn add_group<'f>(&'f mut self, name: &str) -> Result<GroupMut<'f>>
[src]
Add an empty group to the dataset
pub fn add_variable<'f, T>(
&'f mut self,
name: &str,
dims: &[&str]
) -> Result<VariableMut<'f>> where
T: Numeric,
[src]
&'f mut self,
name: &str,
dims: &[&str]
) -> Result<VariableMut<'f>> where
T: Numeric,
Create a Variable into the dataset, with no data written into it
Dimensions are identified using the name of the dimension, and will recurse upwards if not found in the current group.
pub fn add_variable_with_type<'f>(
&'f mut self,
name: &str,
dims: &[&str],
typ: &VariableType
) -> Result<VariableMut<'f>>
[src]
&'f mut self,
name: &str,
dims: &[&str],
typ: &VariableType
) -> Result<VariableMut<'f>>
Create a variable with the specified type
pub fn add_opaque_type<'f>(
&'f mut self,
name: &str,
size: usize
) -> Result<OpaqueType>
[src]
&'f mut self,
name: &str,
size: usize
) -> Result<OpaqueType>
Add an opaque datatype, with size
bytes
pub fn add_vlen_type<'f, T: Numeric>(
&'f mut self,
name: &str
) -> Result<VlenType>
[src]
&'f mut self,
name: &str
) -> Result<VlenType>
Add a variable length datatype
pub fn add_enum_type<'f, T: Numeric>(
&'f mut self,
name: &str,
mappings: &[(&str, T)]
) -> Result<EnumType>
[src]
&'f mut self,
name: &str,
mappings: &[(&str, T)]
) -> Result<EnumType>
Add an enum datatype
pub fn add_compound_type(&mut self, name: &str) -> Result<CompoundBuilder>
[src]
Build a compound type
pub fn add_string_variable<'f>(
&'f mut self,
name: &str,
dims: &[&str]
) -> Result<VariableMut<'f>>
[src]
&'f mut self,
name: &str,
dims: &[&str]
) -> Result<VariableMut<'f>>
Adds a variable with a basic type of string
pub fn add_variable_from_identifiers<'f, T>(
&'f mut self,
name: &str,
dims: &[Identifier]
) -> Result<VariableMut<'f>> where
T: Numeric,
[src]
&'f mut self,
name: &str,
dims: &[Identifier]
) -> Result<VariableMut<'f>> where
T: Numeric,
Adds a variable from a set of unique identifiers, recursing upwards from the current group if necessary.
Methods from Deref<Target = File>
pub fn path(&self) -> Result<PathBuf>
[src]
path used to open/create the file
#Errors
Netcdf layer could fail, or the resulting path could contain an invalid UTF8 sequence
pub fn root(&self) -> Option<Group<'_>>
[src]
Main entrypoint for interacting with the netcdf file.
pub fn variable<'f>(&'f self, name: &str) -> Option<Variable<'f>>
[src]
Get a variable from the group
pub fn variables(&self) -> impl Iterator<Item = Variable<'_>>
[src]
Iterate over all variables in a group
pub fn attribute<'f>(&'f self, name: &str) -> Option<Attribute<'f>>
[src]
Get a single attribute
pub fn attributes(&self) -> impl Iterator<Item = Attribute<'_>>
[src]
Get all attributes in the root group
pub fn dimension<'f>(&self, name: &str) -> Option<Dimension<'f>>
[src]
Get a single dimension
pub fn dimensions(&self) -> impl Iterator<Item = Dimension<'_>>
[src]
Iterator over all dimensions in the root group
pub fn group<'f>(&'f self, name: &str) -> Result<Option<Group<'f>>>
[src]
pub fn groups<'f>(&'f self) -> Result<impl Iterator<Item = Group<'f>>>
[src]
pub fn types(&self) -> Result<impl Iterator<Item = VariableType>>
[src]
Return all types in the root group
Trait Implementations
impl Debug for MutableFile
[src]
impl Deref for MutableFile
[src]
Auto Trait Implementations
impl RefUnwindSafe for MutableFile
impl Send for MutableFile
impl Sync for MutableFile
impl Unpin for MutableFile
impl UnwindSafe for MutableFile
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> Pointable for T
[src]
const ALIGN: usize
[src]
type Init = T
The type for initializers.
unsafe fn init(init: <T as Pointable>::Init) -> usize
[src]
unsafe fn deref<'a>(ptr: usize) -> &'a T
[src]
unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T
[src]
unsafe fn drop(ptr: usize)
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,