extendr_api::prelude

Trait RawDataSubst

Source
pub trait RawDataSubst<A>: RawData {
    type Output: RawData<Elem = A>;

    // Required method
    unsafe fn data_subst(self) -> Self::Output;
}
Expand description

Array representation trait.

The RawDataSubst trait maps the element type of array storage, while keeping the same kind of storage.

For example, RawDataSubst<B> can map the type OwnedRepr<A> to OwnedRepr<B>.

Required Associated Types§

Source

type Output: RawData<Elem = A>

The resulting array storage of the same kind but substituted element type

Required Methods§

Source

unsafe fn data_subst(self) -> Self::Output

Unsafely translate the data representation from one element representation to another.

§Safety

Caller must ensure the two types have the same representation.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§

Source§

impl<'a, A, B> RawDataSubst<B> for CowRepr<'a, A>
where A: 'a, B: 'a,

Source§

type Output = CowRepr<'a, B>

Source§

impl<'a, A, B> RawDataSubst<B> for ViewRepr<&'a A>
where A: 'a, B: 'a,

Source§

impl<'a, A, B> RawDataSubst<B> for ViewRepr<&'a mut A>
where A: 'a, B: 'a,

Source§

impl<A, B> RawDataSubst<B> for OwnedArcRepr<A>

Source§

impl<A, B> RawDataSubst<B> for OwnedRepr<A>

Source§

impl<A, B> RawDataSubst<B> for RawViewRepr<*const A>

Source§

impl<A, B> RawDataSubst<B> for RawViewRepr<*mut A>