pub trait SExt: Sized {
type Data: RType;
// Required methods
fn as_sexp(&self) -> *mut SEXPREC;
fn new(len: <Self::Data as RType>::New) -> Self
where Self: Newable;
// Provided methods
fn is_correct_type(&self) -> bool { ... }
fn len(&self) -> usize { ... }
unsafe fn data_unchecked(&self) -> &[<Self::Data as RType>::Data] { ... }
fn data(&self) -> &[<Self::Data as RType>::Data] { ... }
unsafe fn data_unchecked_mut(&self) -> &mut [<Self::Data as RType>::Data]
where <Self as SExt>::Data: RTypeMut,
Self: Mutable { ... }
fn data_mut(&mut self) -> &mut [<Self::Data as RType>::Data]
where <Self as SExt>::Data: RTypeMut,
Self: Mutable { ... }
}Expand description
SEXP extensions
Contains all the operation that a normal SEXP could execute.
Required Associated Types§
Required Methods§
Provided Methods§
sourcefn is_correct_type(&self) -> bool
fn is_correct_type(&self) -> bool
check whether the data has the desired type
sourceunsafe fn data_unchecked(&self) -> &[<Self::Data as RType>::Data]
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
- SEXP.is_correct_type()
- Self::Data::len(sexp)>0
sourceunsafe fn data_unchecked_mut(&self) -> &mut [<Self::Data as RType>::Data]
unsafe fn data_unchecked_mut(&self) -> &mut [<Self::Data as RType>::Data]
got the read-only data of a SEXP object SAFETY: caller should ensure this SEXP has data with
- SEXP.is_correct_type()
- Self::Data::len(sexp)>0
Object Safety§
This trait is not object safe.