Skip to main content

derive_altrep_complex

Function derive_altrep_complex 

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

Derive macro entry point for AltrepComplex.

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

Supports #[altrep(dataptr)] for direct Rcomplex data pointer access and #[altrep(subset)] for Extract_subset.