pub trait Cast: Element + Item {
// Required method
fn cast(view: View<'_>, item: usize) -> Result<Self, Error>;
// Provided method
fn extend_cast(
view: View<'_>,
len: usize,
checked: bool,
out: &mut Vec<Self>,
) -> Result<(), Error> { ... }
}Expand description
Convert stored items using the destination dtype’s checked conversion.
Required Methods§
Provided Methods§
Sourcefn extend_cast(
view: View<'_>,
len: usize,
checked: bool,
out: &mut Vec<Self>,
) -> Result<(), Error>
fn extend_cast( view: View<'_>, len: usize, checked: bool, out: &mut Vec<Self>, ) -> Result<(), Error>
Appends the first len items of view to out, each as Cast::cast converts it and [kept] keeps it. Element types override this with one typed loop for each source dtype they read often.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".