Sexp

Struct Sexp 

Source
pub struct Sexp<T: RType> { /* private fields */ }
Available on crate feature public-all only.
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.

Implementations§

Source§

impl<T: RType> Sexp<T>

Source

pub const unsafe fn missing(self) -> bool

👎Deprecated: Sexp<T> cannot missing (while the item is registered), using OptionSexp<T> instead.

Sexp means the item is not missing, using OptionSexp<T> if the sexp is optional (The best practice is, never use this!)

Source§

impl Sexp<Rchar>

Source

pub unsafe fn error(self) -> !

REALLY UNSAFE FUNCTION

see error for more informations.

Source

pub fn print(self)

print the content to R… with R’s print function.

It is more preferred than std::println! since output with std::println! might be ignored with windows Rgui.exe.

Source

pub fn eprint(self)

print the content to R… with R’s eprint function.

Trait Implementations§

Source§

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

Source§

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

Returns a duplicate 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> From<Protected<T>> for Sexp<T>

Source§

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

Converts to this type from the input type.
Source§

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

Source§

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>

Source§

type Data = T

SEXP Associated data Read more
Source§

unsafe fn as_sexp(&self) -> SEXP

get the inner SEXP. Read more
Source§

fn stype(&self) -> SEXPTYPE

got SEXPTYPE of the wrapped SEXP type.
Source§

fn new(len: usize) -> Protected<Self::Data>
where Self::Data: RDefault,

allocate a new SEXP object with length, and protect it immeditely Read more
Source§

fn raw(len: usize) -> Owned<Self::Data>
where Self::Data: RDefault,

allocate a new SEXP object with length, and does not protect it. Read more
Source§

fn from( data: impl AsRef<[<Self::Data as RType>::Data]>, ) -> Protected<Self::Data>
where Self::Data: RTypeFrom,

Create a protected R copy from rust object. Read more
Source§

fn raw_from( data: impl AsRef<[<Self::Data as RType>::Data]>, ) -> Owned<Self::Data>
where Self::Data: RTypeFrom,

Create a unprotected R copy from rust object. Read more
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 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>

Source§

impl Send for Sexp<Rchar>

Source§

impl Sync for Sexp<Rchar>

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> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. 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> RTypeFrom for T
where T: RDefault + RTypeMut,

Source§

unsafe fn from(data: impl AsRef<[<T as RType>::Data]>) -> NonNull<*mut SEXPREC>

Available on crate feature public-all only.
create a R copy from rust object.
Source§

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

Source§

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>,

Source§

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>,

Source§

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.