pub trait MaybeNan: Sized {
    type NotNan;

    fn is_nan(&self) -> bool;
    fn try_as_not_nan(&self) -> Option<&Self::NotNan>;
    fn from_not_nan(_: Self::NotNan) -> Self;
    fn from_not_nan_opt(_: Option<Self::NotNan>) -> Self;
    fn from_not_nan_ref_opt(_: Option<&Self::NotNan>) -> &Self;
    fn remove_nan_mut(
        _: ArrayViewMut1<'_, Self>
    ) -> ArrayViewMut1<'_, Self::NotNan>; }
Expand description

A number type that can have not-a-number values.

Required Associated Types

A type that is guaranteed not to be a NaN value.

Required Methods

Returns true if the value is a NaN value.

Tries to convert the value to NotNan.

Returns None if the value is a NaN value.

Converts the value.

If the value is None, a NaN value is returned.

Converts the value.

If the value is None, a NaN value is returned.

Converts the value.

If the value is None, a NaN value is returned.

Returns a view with the NaN values removed.

This modifies the input view by moving elements as necessary. The final order of the elements is unspecified. However, this method is idempotent, and given the same input data, the result is always ordered the same way.

Implementations on Foreign Types

Implementors