Struct rmin::SEXP

source ·
pub struct SEXP<T: RType> { /* private fields */ }
Expand description

ReadOnly SEXP, should not be changed.

This is the preferred way for accept ffi values Since R marked the input values as readonly.

Trait Implementations§

source§

impl<T: Clone + RType> Clone for SEXP<T>

source§

fn clone(&self) -> SEXP<T>

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl<T: RType> From<Owned<T>> for SEXP<T>

source§

fn from(s: Owned<T>) -> Self

Converts to this type from the input type.
source§

impl<T: RType> Index<usize> for SEXP<T>
where SEXP<T>: SExt,

§

type Output = <<SEXP<T> as SExt>::Data as RType>::Data

The returned type after indexing.
source§

fn index(&self, index: usize) -> &<<SEXP<T> as SExt>::Data as RType>::Data

Performs the indexing (container[index]) operation. Read more
source§

impl<T: RTypeMut> IndexMut<usize> for SEXP<T>
where SEXP<T>: Mutable, <SEXP<T> as SExt>::Data: RTypeMut,

source§

fn index_mut( &mut self, index: usize ) -> &mut <<SEXP<T> as SExt>::Data as RType>::Data

Performs the mutable indexing (container[index]) operation. Read more
source§

impl<T: RType> SExt for SEXP<T>

§

type Data = T

SEXP Associated data, normally double->f64, integer->i32, logical->u32, character->u8, Other data might be added in the future.
source§

fn as_sexp(&self) -> *mut SEXPREC

get the inner SEXP.
source§

fn new(len: <Self::Data as RType>::New) -> Self

allocate a new SEXP object with length for u8 (CHARcrate::libR::SEXP), new with length is not allowed thus CHARcrate::libR::SEXP accept a String object.
source§

fn is_correct_type(&self) -> bool

check whether the data has the desired type
source§

fn len(&self) -> usize

get length of this SEXP.
source§

unsafe fn data_unchecked(&self) -> &[<Self::Data as RType>::Data]

got the read-only data of a SEXP object SAFETY: caller should ensure this SEXP has data with Read more
source§

fn data(&self) -> &[<Self::Data as RType>::Data]

got the read-only data of a SEXP object
source§

impl<T: Copy + RType> Copy for SEXP<T>

Auto Trait Implementations§

§

impl<T> Freeze for SEXP<T>

§

impl<T> RefUnwindSafe for SEXP<T>
where T: RefUnwindSafe,

§

impl<T> !Send for SEXP<T>

§

impl<T> !Sync for SEXP<T>

§

impl<T> Unpin for SEXP<T>
where T: Unpin,

§

impl<T> UnwindSafe for SEXP<T>
where T: UnwindSafe,

Blanket Implementations§

source§

impl<T> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for T
where U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T> ToOwned for T
where T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.