Skip to main content

impl_altinteger_from_data

Macro impl_altinteger_from_data 

Source
macro_rules! impl_altinteger_from_data {
    ($ty:ty $(, $knob:ident)*) => { ... };
}
Expand description

Generate ALTREP trait implementations for a type that implements AltIntegerData.

This macro generates impl Altrep, impl AltVec, and impl AltInteger for the type, delegating to the high-level AltIntegerData trait methods.

Requires: The type must implement TypedExternal (use #[derive(ExternalPtr)]).

§Variants

// Basic (no dataptr, no serialization):
impl_altinteger_from_data!(MyType);

// With dataptr (type must implement AltrepDataptr<i32>):
impl_altinteger_from_data!(MyType, dataptr);

// With serialization (type must implement AltrepSerialize):
impl_altinteger_from_data!(MyType, serialize);

// With subset optimization (type must implement AltrepExtractSubset):
impl_altinteger_from_data!(MyType, subset);

// Combine multiple options:
impl_altinteger_from_data!(MyType, dataptr, serialize);
impl_altinteger_from_data!(MyType, subset, serialize);