pub trait RCowCompatibleRef<'a>: ToOwned {
    type RefC: IntoOwned<ROwned = Self::ROwned, Target = Self>;
    type ROwned: Borrow<Self> + Into<Self::Owned> + From<Self::Owned>;

    // Required methods
    fn as_c_ref(from: &'a Self) -> Self::RefC;
    fn as_rust_ref(from: Self::RefC) -> &'a Self;
}
Expand description

For making a Cow<'a, Self> convertible into an RCow.

Required Associated Types§

source

type RefC: IntoOwned<ROwned = Self::ROwned, Target = Self>

The (preferably) ffi-safe equivalent of &Self.

source

type ROwned: Borrow<Self> + Into<Self::Owned> + From<Self::Owned>

The owned version of Self::RefC.

Required Methods§

source

fn as_c_ref(from: &'a Self) -> Self::RefC

Converts a reference to an FFI-safe type

source

fn as_rust_ref(from: Self::RefC) -> &'a Self

Converts an FFI-safe type to a reference

Object Safety§

This trait is not object safe.

Implementations on Foreign Types§

source§

impl<'a> RCowCompatibleRef<'a> for str

§

type RefC = RStr<'a>

§

type ROwned = RString

source§

fn as_c_ref(from: &'a Self) -> Self::RefC

source§

fn as_rust_ref(from: Self::RefC) -> &'a Self

source§

impl<'a, T: Clone + 'a> RCowCompatibleRef<'a> for [T]

§

type RefC = RSlice<'a, T>

§

type ROwned = RVec<T>

source§

fn as_c_ref(from: &'a Self) -> Self::RefC

source§

fn as_rust_ref(from: Self::RefC) -> &'a Self

Implementors§

source§

impl<'a, T: Clone + 'a> RCowCompatibleRef<'a> for T

§

type RefC = &'a T

§

type ROwned = T