FlexRc

Struct FlexRc 

Source
#[repr(C)]
pub struct FlexRc<META, META2, T>
where META: Algorithm<META, META2>, META2: Algorithm<META2, META>, T: ?Sized,
{ /* private fields */ }

Implementations§

Source§

impl<META, META2, T> FlexRc<META, META2, T>
where META: Algorithm<META, META2>, META2: Algorithm<META2, META>,

Source

pub fn new(data: T) -> Self

Source

pub fn from_ref(data: &T) -> Self
where T: Clone,

Source

pub fn get_mut(&mut self) -> Option<&mut T>

Source

pub unsafe fn get_mut_unchecked(&mut self) -> &mut T

§Safety

The user is trusted they are to be the sole owner before calling this (typically at init time)

Source§

impl<META, META2, T> FlexRc<META, META2, [T]>
where META: Algorithm<META, META2>, META2: Algorithm<META2, META>, T: Copy,

Source

pub fn new_slice_uninit(len: usize) -> FlexRc<META, META2, [MaybeUninit<T>]>

Source

pub fn from_slice(data: &[T]) -> Self

Source§

impl<META, META2, T> FlexRc<META, META2, [MaybeUninit<T>]>
where META: Algorithm<META, META2>, META2: Algorithm<META2, META>,

Source

pub unsafe fn assume_init(self) -> FlexRc<META, META2, [T]>

§Safety

We have unique ownership. We are trusting the user that this memory has been initialized (thus why it is an unsafe function)

Source§

impl<META, META2> FlexRc<META, META2, [u8]>
where META: Algorithm<META, META2>, META2: Algorithm<META2, META>,

Source

pub fn from_str_ref(s: impl AsRef<str>) -> FlexRc<META, META2, [u8]>

Source§

impl<META, META2, T> FlexRc<META, META2, T>
where META: Algorithm<META, META2>, META2: Algorithm<META2, META>, T: ?Sized,

Source

pub fn try_into_other(self) -> Result<FlexRc<META2, META, T>, Self>

Try to convert this into a type with the other type of metadata for the pair (local -> shared, or shared -> local). If it is possible it will return the new type, else it will fail and return itself instead

Source

pub fn into_other(self) -> FlexRc<META2, META, T>
where T: Clone,

Try to convert this into a type with the other type of metadata for the pair (local -> shared, or shared -> local). If it is possible it will return the new type without additional copy or allocation, but if not possible, it will clone the underlying data and return a new Rc

Source

pub fn try_to_other(&self) -> Result<FlexRc<META2, META, T>, &Self>

Try to create another instance of this Rc with the other type of metadata for the pair (local -> shared, or shared -> local). If it is possible to create this new instance without allocation or copying it will return it, else it will fail and return a ref to the same instance

Source

pub fn to_other(&self) -> FlexRc<META2, META, T>
where T: Clone,

Try to create another instance of this Rc with the other type of metadata for the pair (local -> shared, or shared -> local). If it is possible to create this new instance without allocation or copying it will return it, else it clone the underlying data and return a new Rc

Trait Implementations§

Source§

impl<META, META2, T> Clone for FlexRc<META, META2, T>
where META: Algorithm<META, META2>, META2: Algorithm<META2, META>, T: ?Sized,

Source§

fn clone(&self) -> Self

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<META, META2, T> Deref for FlexRc<META, META2, T>
where META: Algorithm<META, META2>, META2: Algorithm<META2, META>,

Source§

type Target = T

The resulting type after dereferencing.
Source§

fn deref(&self) -> &Self::Target

Dereferences the value.
Source§

impl<META, META2, T> Drop for FlexRc<META, META2, T>
where META: Algorithm<META, META2>, META2: Algorithm<META2, META>, T: ?Sized,

Source§

fn drop(&mut self)

Executes the destructor for this type. Read more

Auto Trait Implementations§

§

impl<META, META2, T> Freeze for FlexRc<META, META2, T>
where T: ?Sized,

§

impl<META, META2, T> RefUnwindSafe for FlexRc<META, META2, T>
where META: RefUnwindSafe, T: RefUnwindSafe + ?Sized, META2: RefUnwindSafe,

§

impl<META, META2, T> !Send for FlexRc<META, META2, T>

§

impl<META, META2, T> !Sync for FlexRc<META, META2, T>

§

impl<META, META2, T> Unpin for FlexRc<META, META2, T>
where META: Unpin, T: Unpin + ?Sized, META2: Unpin,

§

impl<META, META2, T> UnwindSafe for FlexRc<META, META2, T>

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<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<P, T> Receiver for P
where P: Deref<Target = T> + ?Sized, T: ?Sized,

Source§

type Target = T

🔬This is a nightly-only experimental API. (arbitrary_self_types)
The target type on which the method may be called.
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.