Struct savvy::sexp::string::StringSexp

source ·
pub struct StringSexp(pub SEXP);
Expand description

An external SEXP of a character vector.

Tuple Fields§

§0: SEXP

Implementations§

source§

impl StringSexp

source

pub fn inner(&self) -> SEXP

Returns the raw SEXP.

source

pub fn len(&self) -> usize

Returns the length of the SEXP.

source

pub fn is_empty(&self) -> bool

Returns true if the SEXP is of zero-length.

source

pub fn get_attrib(&self, attr: &str) -> Result<Option<Sexp>>

Returns the specified attribute.

source

pub fn get_names(&self) -> Option<Vec<&'static str>>

Returns the names.

source

pub fn get_class(&self) -> Option<Vec<&'static str>>

Returns the S3 class.

source

pub fn get_dim(&self) -> Option<&[i32]>

Returns the dimension.

source§

impl StringSexp

source

pub fn iter(&self) -> StringSexpIter<'_>

source

pub fn to_vec(&self) -> Vec<&'static str>

Trait Implementations§

source§

impl From<StringSexp> for Result<Sexp>

source§

fn from(value: StringSexp) -> Self

Converts to this type from the input type.
source§

impl From<StringSexp> for Sexp

source§

fn from(value: StringSexp) -> Self

Converts to this type from the input type.
source§

impl From<StringSexp> for TypedSexp

source§

fn from(value: StringSexp) -> Self

Converts to this type from the input type.
source§

impl TryFrom<Sexp> for StringSexp

§

type Error = Error

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

fn try_from(value: Sexp) -> Result<Self>

Performs the conversion.

Auto Trait Implementations§

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