pub trait Slices: GetSexp {
// Provided methods
unsafe fn as_typed_slice_raw<T>(&self) -> &[T] { ... }
unsafe fn as_typed_slice_raw_mut<T>(&mut self) -> &mut [T] { ... }
}
Provided Methods§
Sourceunsafe fn as_typed_slice_raw<T>(&self) -> &[T]
unsafe fn as_typed_slice_raw<T>(&self) -> &[T]
Get an immutable slice to this object’s data.
§Safety
Unless the type is correct, this will cause undefined behaviour. Creating this slice will also instantiate an Altrep objects.
Sourceunsafe fn as_typed_slice_raw_mut<T>(&mut self) -> &mut [T]
unsafe fn as_typed_slice_raw_mut<T>(&mut self) -> &mut [T]
Get a mutable slice to this object’s data.
§Safety
Unless the type is correct, this will cause undefined behaviour. Creating this slice will also instantiate Altrep objects. Not all objects (especially not list and strings) support this.
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.
Implementors§
impl Slices for Altrep
as_typed_slice_raw() etc.
impl Slices for Complexes
as_typed_slice_raw() etc.
impl Slices for Doubles
as_typed_slice_raw() etc.
impl Slices for Environment
as_typed_slice_raw() etc.
impl Slices for Expressions
as_typed_slice_raw() etc.
impl Slices for Function
as_typed_slice_raw() etc.
impl Slices for Integers
as_typed_slice_raw() etc.
impl Slices for Language
as_typed_slice_raw() etc.
impl Slices for List
as_typed_slice_raw() etc.
impl Slices for Logicals
as_typed_slice_raw() etc.
impl Slices for Pairlist
as_typed_slice_raw() etc.
impl Slices for Primitive
as_typed_slice_raw() etc.
impl Slices for Promise
as_typed_slice_raw() etc.
impl Slices for Raw
as_typed_slice_raw() etc.
impl Slices for Rstr
as_typed_slice_raw() etc.
impl Slices for S4
as_typed_slice_raw() etc.
impl Slices for Strings
as_typed_slice_raw() etc.
impl Slices for Symbol
as_typed_slice_raw() etc.
impl Slices for Robj
impl<T> Slices for Dataframe<T>
as_typed_slice_raw() etc.
impl<T> Slices for ExternalPtr<T>
as_typed_slice_raw() etc.