Skip to main content

RootedVecElement

Trait RootedVecElement 

Source
#[doc(hidden)]
pub trait RootedVecElement<'a>: Sized { const NATIVE_BORROW: Option<NativeBorrow>; // Required method fn vec_from_root(root: Root<'a>) -> Result<Vec<Self>, SexpError>; }
Expand description

An element type of a Vec that converts through TryFromRoot. The element decides what the vector reads: character elements read a STRSXP, the others read a list. One Vec<E> impl over this trait, rather than one impl per element shape, keeps a nested Vec<Vec<..>> from sending type inference into unbounded recursion when the element type is not yet known.

Required Associated Constants§

Source

const NATIVE_BORROW: Option<NativeBorrow>

Native storage the vector borrows, for wrapper alias checks.

Required Methods§

Source

fn vec_from_root(root: Root<'a>) -> Result<Vec<Self>, SexpError>

Convert every element, retaining each one an ALTREP accessor returns.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementations on Foreign Types§

Source§

impl<'a, E: RootedVecElement<'a>> RootedVecElement<'a> for Option<Vec<E>>
where Option<Vec<E>>: TryFromRoot<'a>, <Option<Vec<E>> as TryFromRoot<'a>>::Error: Into<SexpError>,

Source§

impl<'a, E: RootedVecElement<'a>> RootedVecElement<'a> for Vec<E>
where Vec<E>: TryFromRoot<'a>, <Vec<E> as TryFromRoot<'a>>::Error: Into<SexpError>,

Source§

impl<'a, T: RNativeType> RootedVecElement<'a> for &'a T

Source§

impl<'a, T: RNativeType> RootedVecElement<'a> for &'a [T]
where &'a [T]: TryFromRoot<'a>, <&'a [T] as TryFromRoot<'a>>::Error: Into<SexpError>,

Source§

impl<'a, T: RNativeType> RootedVecElement<'a> for Option<&'a T>

Source§

impl<'a, T: RNativeType> RootedVecElement<'a> for Option<&'a [T]>
where Option<&'a [T]>: TryFromRoot<'a>, <Option<&'a [T]> as TryFromRoot<'a>>::Error: Into<SexpError>,

Source§

impl<'a> RootedVecElement<'a> for &'a str

Source§

impl<'a> RootedVecElement<'a> for Cow<'a, str>

Source§

impl<'a> RootedVecElement<'a> for Option<&'a str>

Source§

impl<'a> RootedVecElement<'a> for Option<Cow<'a, str>>

Implementors§