Expand description
ALTREP implementation utilities.
This module provides helper functions used by the declarative macros
generated for ALTREP classes. The proc-macro derives (#[derive(AltrepInteger)]
etc.) lower to invocations of impl_alt*_from_data! macros which expand
to code that references items in this module via $crate::altrep_impl::*
paths.
Use crate::altrep_data1_as (re-exported from externalptr) to extract
data from an ALTREP’s data1 slot.
§Layout
macros—#[macro_export]declarative macros (impl_alt*_from_data!and their__impl_*helpers).builtins— crate-private meta-macro + invocations forVec<T>/Box<[T]>/Cow<T>/Range<T>ALTREP families.arrays— const-generic[T; N]ALTREP impls.static_slices— hand-written&'static [T]ALTREP impls.
Modules§
- arrays
- ALTREP impls for const-generic arrays
[T; N]. - builtins
- Built-in ALTREP class instantiations for
Vec<T>,Box<[T]>,Cow<T>, andRange<T>. - macros
- Declarative macros generating ALTREP trait implementations.
- static_
slices - ALTREP impls for
&'static [T].
Functions§
- altrep_
region_ ⚠buf - Create a mutable slice from an ALTREP
get_regionoutput buffer pointer. - checked_
mkchar ⚠ - Create a CHARSXP from a Rust string, with checked length conversion.