pub trait RegisterAltrep {
// Required method
fn get_or_init_class() -> R_altrep_class_t;
}Expand description
Registration trait: implemented per type by the macro on struct items.
The get_or_init_class method returns the ALTREP class handle, initializing
it on first call and returning the cached handle on subsequent calls.
This trait combines class creation and method installation into a single
get_or_init_class call that caches the result.
Required Methods§
Sourcefn get_or_init_class() -> R_altrep_class_t
fn get_or_init_class() -> R_altrep_class_t
Get the ALTREP class handle, initializing it if this is the first call.
The implementation should:
- Create the class handle via
R_make_alt*(or viaInferBase::make_class) - Install methods via
install_*functions fromaltrep_bridge - Cache the result in a static
OnceLock
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.