Skip to main content

NamedVector

Struct NamedVector 

Source
pub struct NamedVector<M>(pub M);
Expand description

Wrapper that converts a map to/from a named atomic R vector instead of a named list.

The inner map must have String keys and values that implement AtomicElement.

§Supported value types

Rust typeR SEXPTYPE
i32INTSXP
f64REALSXP
u8RAWSXP
boolLGLSXP
StringSTRSXP
Option<i32>INTSXP (NA = NA_INTEGER)
Option<f64>REALSXP (NA = NA_REAL)
Option<bool>LGLSXP (NA = NA_LOGICAL)
Option<String>STRSXP (NA = NA_character_)

Tuple Fields§

§0: M

Implementations§

Source§

impl<M> NamedVector<M>

Source

pub fn into_inner(self) -> M

Unwrap, returning the inner map.

Trait Implementations§

Source§

impl<M: Clone> Clone for NamedVector<M>

Source§

fn clone(&self) -> NamedVector<M>

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<M: Debug> Debug for NamedVector<M>

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<M> From<M> for NamedVector<M>

Source§

fn from(m: M) -> Self

Converts to this type from the input type.
Source§

impl<V: AtomicElement> IntoR for NamedVector<BTreeMap<String, V>>

Source§

type Error = Infallible

The error type for fallible conversions. Read more
Source§

fn try_into_sexp(self) -> Result<SEXP, Self::Error>

Try to convert this value to an R SEXP. Read more
Source§

unsafe fn try_into_sexp_unchecked(self) -> Result<SEXP, Self::Error>

Try to convert to SEXP without thread safety checks. Read more
Source§

fn into_sexp(self) -> SEXP

Convert this value to an R SEXP, panicking on error. Read more
Source§

unsafe fn into_sexp_unchecked(self) -> SEXP
where Self: Sized,

Convert to SEXP without thread safety checks, panicking on error. Read more
Source§

impl<V: AtomicElement> IntoR for NamedVector<HashMap<String, V>>

Source§

type Error = Infallible

The error type for fallible conversions. Read more
Source§

fn try_into_sexp(self) -> Result<SEXP, Self::Error>

Try to convert this value to an R SEXP. Read more
Source§

unsafe fn try_into_sexp_unchecked(self) -> Result<SEXP, Self::Error>

Try to convert to SEXP without thread safety checks. Read more
Source§

fn into_sexp(self) -> SEXP

Convert this value to an R SEXP, panicking on error. Read more
Source§

unsafe fn into_sexp_unchecked(self) -> SEXP
where Self: Sized,

Convert to SEXP without thread safety checks, panicking on error. Read more
Source§

impl<M: PartialEq> PartialEq for NamedVector<M>

Source§

fn eq(&self, other: &NamedVector<M>) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl<V: AtomicElement> TryFromSexp for NamedVector<BTreeMap<String, V>>

Source§

type Error = SexpError

The error type returned when conversion fails.
Source§

fn try_from_sexp(sexp: SEXP) -> Result<Self, Self::Error>

Attempt to convert an R SEXP to this Rust type. Read more
Source§

unsafe fn try_from_sexp_unchecked(sexp: SEXP) -> Result<Self, Self::Error>

Convert from SEXP without thread safety checks. Read more
Source§

impl<V: AtomicElement> TryFromSexp for NamedVector<HashMap<String, V>>

Source§

type Error = SexpError

The error type returned when conversion fails.
Source§

fn try_from_sexp(sexp: SEXP) -> Result<Self, Self::Error>

Attempt to convert an R SEXP to this Rust type. Read more
Source§

unsafe fn try_from_sexp_unchecked(sexp: SEXP) -> Result<Self, Self::Error>

Convert from SEXP without thread safety checks. Read more
Source§

impl<M: Eq> Eq for NamedVector<M>

Source§

impl<M> StructuralPartialEq for NamedVector<M>

Auto Trait Implementations§

§

impl<M> Freeze for NamedVector<M>
where M: Freeze,

§

impl<M> RefUnwindSafe for NamedVector<M>
where M: RefUnwindSafe,

§

impl<M> Send for NamedVector<M>
where M: Send,

§

impl<M> Sync for NamedVector<M>
where M: Sync,

§

impl<M> Unpin for NamedVector<M>
where M: Unpin,

§

impl<M> UnsafeUnpin for NamedVector<M>
where M: UnsafeUnpin,

§

impl<M> UnwindSafe for NamedVector<M>
where M: 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<!> for T

Source§

fn from(t: !) -> T

Converts to this type from the input type.
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> RClone for T
where T: Clone,

Source§

fn clone(&self) -> T

Create a deep copy of this value.
Source§

impl<T> RDebug for T
where T: Debug,

Source§

fn debug_str(&self) -> String

Get a compact debug string representation.
Source§

fn debug_str_pretty(&self) -> String

Get a pretty-printed debug string with indentation.
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.