Enum agnes::masked::MaybeNa
[−]
[src]
pub enum MaybeNa<T: DataType> { Na, Exists(T), }
Missing value container.
Variants
Na
Indicates a missing (NA) value.
Exists(T)
Indicates an existing value.
Methods
impl<T: DataType> MaybeNa<T>
[src]
pub fn unwrap(self) -> T
[src]
Unwrap a MaybeNa
, revealing the data contained within. Panics if called on an Na
value.
pub fn exists(&self) -> bool
[src]
Test if a MaybeNa
contains a value.
pub fn is_na(&self) -> bool
[src]
Test if a MaybeNa
is NA.
pub fn as_ref<'a>(&'a self) -> MaybeNa<&'a T>
[src]
Returns a MaybeNa
which contains a reference to the original underlying datum.
pub fn map<U: DataType, F: FnMut(T) -> U>(self, f: F) -> MaybeNa<U>
[src]
Applies function f
if this MaybeNa
exists.
impl<'a, T: DataType + Clone> MaybeNa<&'a T>
[src]
pub fn cloned(self) -> MaybeNa<T>
[src]
Create a owner MaybeNa
out of a reference-holding MaybeNa
using clone()
.
Trait Implementations
impl<T: Debug + DataType> Debug for MaybeNa<T>
[src]
fn fmt(&self, __arg_0: &mut Formatter) -> Result
[src]
Formats the value using the given formatter. Read more
impl<T: Clone + DataType> Clone for MaybeNa<T>
[src]
fn clone(&self) -> MaybeNa<T>
[src]
Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)
1.0.0[src]
Performs copy-assignment from source
. Read more
impl<T: PartialEq + DataType> PartialEq for MaybeNa<T>
[src]
fn eq(&self, __arg_0: &MaybeNa<T>) -> bool
[src]
This method tests for self
and other
values to be equal, and is used by ==
. Read more
fn ne(&self, __arg_0: &MaybeNa<T>) -> bool
[src]
This method tests for !=
.
impl<T: Eq + DataType> Eq for MaybeNa<T>
[src]
impl<T: PartialOrd + DataType> PartialOrd for MaybeNa<T>
[src]
fn partial_cmp(&self, __arg_0: &MaybeNa<T>) -> Option<Ordering>
[src]
This method returns an ordering between self
and other
values if one exists. Read more
fn lt(&self, __arg_0: &MaybeNa<T>) -> bool
[src]
This method tests less than (for self
and other
) and is used by the <
operator. Read more
fn le(&self, __arg_0: &MaybeNa<T>) -> bool
[src]
This method tests less than or equal to (for self
and other
) and is used by the <=
operator. Read more
fn gt(&self, __arg_0: &MaybeNa<T>) -> bool
[src]
This method tests greater than (for self
and other
) and is used by the >
operator. Read more
fn ge(&self, __arg_0: &MaybeNa<T>) -> bool
[src]
This method tests greater than or equal to (for self
and other
) and is used by the >=
operator. Read more
impl<T: Ord + DataType> Ord for MaybeNa<T>
[src]
fn cmp(&self, __arg_0: &MaybeNa<T>) -> Ordering
[src]
This method returns an Ordering
between self
and other
. Read more
fn max(self, other: Self) -> Self
1.21.0[src]
Compares and returns the maximum of two values. Read more
fn min(self, other: Self) -> Self
1.21.0[src]
Compares and returns the minimum of two values. Read more
impl<T: ToString + DataType> ToString for MaybeNa<T>
[src]
impl<D: DataType> IntoMaybeNa for MaybeNa<D>
[src]
type DType = D
The DataType
of the resulting MaybeNa
type,
fn into_maybena(self) -> MaybeNa<D>
[src]
Convert this type into a MaybeNa
.