pub trait IsNA: RNativeType {
// Required method
fn is_na(&self) -> bool;
}Expand description
Native R elements with an actual NA representation.
This is the missing-value capability bound for native buffers. It excludes
u8: R raw vectors have no NA, even though RNativeType::R_NA uses zero
to fill absent raw positions. The existing R_NA constant constructs the
sentinel; is_na recognizes it, including computed real NAs.
For floating point this follows R’s R_IsNA, not R’s is.na() or
anyNA(): ordinary NaNs are not NA sentinels. In particular, ALTREP
no_na hints must still reject ordinary NaNs too.
Rust values without native NA storage use Option<T> at conversion
boundaries; no additional NA<T> wrapper is needed. Native newtypes
can use #[derive(IsNA)] to forward this check to their single field.
Required Methods§
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".