pub struct FileMem<'buffer>(/* private fields */);
Available on crate feature
has-mmap
only.Expand description
The memory mapped file is kept in this structure to extend the lifetime of the buffer.
Access a File
through the Deref
trait,
let buffer = &[0, 42, 1, 2];
let file = &netcdf::open_mem(None, buffer)?;
let variables = file.variables();
Methods from Deref<Target = File>§
sourcepub fn path(&self) -> Result<PathBuf>
pub fn path(&self) -> Result<PathBuf>
path used to open/create the file
#Errors
Netcdf layer could fail, or the resulting path could contain an invalid UTF8 sequence
sourcepub fn variable<'f>(&'f self, name: &str) -> Option<Variable<'f>>
pub fn variable<'f>(&'f self, name: &str) -> Option<Variable<'f>>
Get a variable from the group
sourcepub fn variables(&self) -> impl Iterator<Item = Variable<'_>>
pub fn variables(&self) -> impl Iterator<Item = Variable<'_>>
Iterate over all variables in a group
sourcepub fn attributes(&self) -> impl Iterator<Item = Attribute<'_>>
pub fn attributes(&self) -> impl Iterator<Item = Attribute<'_>>
Get all attributes in the root group
sourcepub fn dimensions(&self) -> impl Iterator<Item = Dimension<'_>>
pub fn dimensions(&self) -> impl Iterator<Item = Dimension<'_>>
Iterator over all dimensions in the root group
sourcepub fn types(&self) -> Result<impl Iterator<Item = VariableType>>
pub fn types(&self) -> Result<impl Iterator<Item = VariableType>>
Return all types in the root group
Trait Implementations§
Auto Trait Implementations§
impl<'buffer> Freeze for FileMem<'buffer>
impl<'buffer> RefUnwindSafe for FileMem<'buffer>
impl<'buffer> Send for FileMem<'buffer>
impl<'buffer> Sync for FileMem<'buffer>
impl<'buffer> Unpin for FileMem<'buffer>
impl<'buffer> UnwindSafe for FileMem<'buffer>
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