extendr_api::robj

Trait Slices

Source
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§

Source

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.

Source

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§

Source§

impl Slices for Altrep

as_typed_slice_raw() etc.

Source§

impl Slices for Complexes

as_typed_slice_raw() etc.

Source§

impl Slices for Doubles

as_typed_slice_raw() etc.

Source§

impl Slices for Environment

as_typed_slice_raw() etc.

Source§

impl Slices for Expressions

as_typed_slice_raw() etc.

Source§

impl Slices for Function

as_typed_slice_raw() etc.

Source§

impl Slices for Integers

as_typed_slice_raw() etc.

Source§

impl Slices for Language

as_typed_slice_raw() etc.

Source§

impl Slices for List

as_typed_slice_raw() etc.

Source§

impl Slices for Logicals

as_typed_slice_raw() etc.

Source§

impl Slices for Pairlist

as_typed_slice_raw() etc.

Source§

impl Slices for Primitive

as_typed_slice_raw() etc.

Source§

impl Slices for Promise

as_typed_slice_raw() etc.

Source§

impl Slices for Raw

as_typed_slice_raw() etc.

Source§

impl Slices for Rstr

as_typed_slice_raw() etc.

Source§

impl Slices for S4

as_typed_slice_raw() etc.

Source§

impl Slices for Strings

as_typed_slice_raw() etc.

Source§

impl Slices for Symbol

as_typed_slice_raw() etc.

Source§

impl Slices for Robj

Source§

impl<T> Slices for Dataframe<T>

as_typed_slice_raw() etc.

Source§

impl<T> Slices for ExternalPtr<T>

as_typed_slice_raw() etc.