pub trait AltrepLen {
// Required method
fn altrep_len(&self) -> usize;
// Provided method
fn altrep_is_empty(&self) -> bool { ... }
}Expand description
Base trait for ALTREP data types. All ALTREP types must provide length.
The altrep_ prefix keeps importing this trait from changing ordinary
len() / is_empty() calls on arrays, slices and their owners.
Required Methods§
Sourcefn altrep_len(&self) -> usize
fn altrep_len(&self) -> usize
Returns the length of this ALTREP vector.
Provided Methods§
Sourcefn altrep_is_empty(&self) -> bool
fn altrep_is_empty(&self) -> bool
Returns true if the vector is empty.
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".