Skip to main content

AltrepIteratorItem

Trait AltrepIteratorItem 

Source
pub trait AltrepIteratorItem: Sized {
    type Data<I: Iterator<Item = Self>>: AltrepLen;

    // Required method
    fn into_data<I: Iterator<Item = Self>>(iter: I, len: usize) -> Self::Data<I>;
}
Expand description

Choose the ALTREP data family for an iterator’s element type.

Built-in mappings cover native numeric values, logicals and owned strings. A local element type may implement this trait to select its own data adapter (for example, an existing coercing adapter). The resulting data still needs a concrete registered class, which owns duplication and serialization policy.

Raw SEXP is deliberately not inferred: storing one requires a GC-root owner.

Required Associated Types§

Source

type Data<I: Iterator<Item = Self>>: AltrepLen

Data adapter retaining the concrete iterator type.

Required Methods§

Source

fn into_data<I: Iterator<Item = Self>>(iter: I, len: usize) -> Self::Data<I>

Store the iterator without advancing it.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementations on Foreign Types§

Source§

impl AltrepIteratorItem for String

Source§

type Data<I: Iterator<Item = Self>> = IterStringData<I>

Source§

fn into_data<I: Iterator<Item = Self>>(iter: I, len: usize) -> Self::Data<I>

Source§

impl AltrepIteratorItem for bool

Source§

type Data<I: Iterator<Item = Self>> = IterLogicalData<I>

Source§

fn into_data<I: Iterator<Item = Self>>(iter: I, len: usize) -> Self::Data<I>

Source§

impl AltrepIteratorItem for f64

Source§

type Data<I: Iterator<Item = Self>> = IterRealData<I>

Source§

fn into_data<I: Iterator<Item = Self>>(iter: I, len: usize) -> Self::Data<I>

Source§

impl AltrepIteratorItem for i32

Source§

type Data<I: Iterator<Item = Self>> = IterIntData<I>

Source§

fn into_data<I: Iterator<Item = Self>>(iter: I, len: usize) -> Self::Data<I>

Source§

impl AltrepIteratorItem for u8

Source§

type Data<I: Iterator<Item = Self>> = IterRawData<I>

Source§

fn into_data<I: Iterator<Item = Self>>(iter: I, len: usize) -> Self::Data<I>

Source§

impl<T: IsNA + AltrepIteratorItem> AltrepIteratorItem for Option<T>

Source§

type Data<I: Iterator<Item = Self>> = <T as AltrepIteratorItem>::Data<Map<I, fn(Option<T>) -> T>>

Source§

fn into_data<I: Iterator<Item = Self>>(iter: I, len: usize) -> Self::Data<I>

Implementors§