Skip to main content

derive_altrep_logical

Function derive_altrep_logical 

Source
pub fn derive_altrep_logical(input: DeriveInput) -> Result<TokenStream>
Expand description

Derive macro entry point for AltrepLogical.

Auto-implements AltrepLen and AltLogicalData for a struct with a length field. The elt() method returns self.{elt_field}.into() as Logical if #[altrep(elt = "...")] is specified, or Logical::Na by default.

Supports #[altrep(dataptr)] for direct i32 data pointer access (logicals are stored as i32 in R) and #[altrep(subset)] for Extract_subset.