Trait extendr_api::robj::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 instatiate and 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 instatiate and Altrep objects. Not all obejects (especially not list and strings) support this.

Object Safety§

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: Debug + 'static> Slices for ExternalPtr<T>

as_typed_slice_raw() etc.