Struct netcdf::FileMem

source ·
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>§

source

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

source

pub fn root(&self) -> Option<Group<'_>>

Main entrypoint for interacting with the netcdf file.

source

pub fn variable<'f>(&'f self, name: &str) -> Option<Variable<'f>>

Get a variable from the group

source

pub fn variables(&self) -> impl Iterator<Item = Variable<'_>>

Iterate over all variables in a group

source

pub fn attribute<'f>(&'f self, name: &str) -> Option<Attribute<'f>>

Get a single attribute

source

pub fn attributes(&self) -> impl Iterator<Item = Attribute<'_>>

Get all attributes in the root group

source

pub fn dimension<'f>(&self, name: &str) -> Option<Dimension<'f>>

Get a single dimension

source

pub fn dimensions(&self) -> impl Iterator<Item = Dimension<'_>>

Iterator over all dimensions in the root group

source

pub fn group<'f>(&'f self, name: &str) -> Result<Option<Group<'f>>>

Get a group

§Errors

Not a netCDF-4 file

source

pub fn groups(&self) -> Result<impl Iterator<Item = Group<'_>>>

Iterator over all subgroups in the root group

§Errors

Not a netCDF-4 file

source

pub fn types(&self) -> Result<impl Iterator<Item = VariableType>>

Return all types in the root group

Trait Implementations§

source§

impl<'a> Deref for FileMem<'a>

§

type Target = File

The resulting type after dereferencing.
source§

fn deref(&self) -> &Self::Target

Dereferences the value.

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> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for T
where U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.