pub struct NcValueView<'a> { /* private fields */ }Expand description
A borrowed view of one logical NetCDF-4 value.
NcValueView lets callers decode directly into domain types without first
allocating a full NcValue tree. Use NcValueView::to_owned_value for
the dynamic representation.
Implementations§
Source§impl<'a> NcValueView<'a>
impl<'a> NcValueView<'a>
Sourcepub fn to_owned_value(&self) -> Result<NcValue>
pub fn to_owned_value(&self) -> Result<NcValue>
Decode this value into the dynamic owned representation.
Sourcepub fn integer(&self) -> Result<NcIntegerValue>
pub fn integer(&self) -> Result<NcIntegerValue>
Decode this value as a NetCDF integer or enum base integer.
Sourcepub fn enum_value(&self) -> Result<NcEnumValue>
pub fn enum_value(&self) -> Result<NcEnumValue>
Decode this value as a NetCDF-4 enum.
Sourcepub fn opaque_bytes(&self) -> Result<&'a [u8]>
pub fn opaque_bytes(&self) -> Result<&'a [u8]>
Borrow this value as an opaque byte blob.
Sourcepub fn compound_field(&self, name: &str) -> Result<NcValueView<'a>>
pub fn compound_field(&self, name: &str) -> Result<NcValueView<'a>>
Borrow a field from a compound value by name.
Sourcepub fn compound_fields(&self) -> Result<Vec<NcCompoundFieldView<'a>>>
pub fn compound_fields(&self) -> Result<Vec<NcCompoundFieldView<'a>>>
Borrow all fields from a compound value in declaration order.
Sourcepub fn array_elements(&self) -> Result<Vec<NcValueView<'a>>>
pub fn array_elements(&self) -> Result<Vec<NcValueView<'a>>>
Borrow all fixed-size array elements in row-major order.
Sourcepub fn vlen_values(&self) -> Result<Vec<NcValue>>
pub fn vlen_values(&self) -> Result<Vec<NcValue>>
Decode a non-string vlen value into owned values.
Trait Implementations§
Source§impl<'a> Clone for NcValueView<'a>
impl<'a> Clone for NcValueView<'a>
Source§fn clone(&self) -> NcValueView<'a>
fn clone(&self) -> NcValueView<'a>
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreimpl<'a> Copy for NcValueView<'a>
Auto Trait Implementations§
impl<'a> Freeze for NcValueView<'a>
impl<'a> !RefUnwindSafe for NcValueView<'a>
impl<'a> Send for NcValueView<'a>
impl<'a> Sync for NcValueView<'a>
impl<'a> Unpin for NcValueView<'a>
impl<'a> UnsafeUnpin for NcValueView<'a>
impl<'a> !UnwindSafe for NcValueView<'a>
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more