Struct RcuRef

Source
pub struct RcuRef<T, M>
where T: ?Sized, M: ?Sized,
{ /* private fields */ }
Expand description

A smard pointer for a reference to the content of an super::Rcu

Implementations§

Source§

impl<T: ?Sized> RcuRef<T, T>

Source

pub fn new(arc: Arc<T>) -> Self

Create a new RcuRef from an Arc

Source§

impl<T: ?Sized, M: ?Sized> RcuRef<T, M>

Source

pub fn map<N: ?Sized, F: for<'a> FnOnce(&'a M) -> &'a N>( reference: Self, f: F, ) -> RcuRef<T, N>

apply the mapping function to the reference in this RcuRef

Source

pub fn try_map<N: ?Sized, F: for<'a> FnOnce(&'a M) -> Option<&'a N>>( reference: Self, f: F, ) -> Option<RcuRef<T, N>>

try to apply the faillable mapping function to the reference in this RcuRef

Source

pub fn same_epoch<M2>(this: &Self, other: &RcuRef<T, M2>) -> bool

Check whether the two RcuRefs reference values in the same epoch

Source

pub fn ptr_eq(this: &Self, other: &Self) -> bool

Compares the RcuRefs references via core::ptr::eq

Source

pub fn ptr_addr_eq(this: &Self, other: &Self) -> bool

Compares the RcuRefs references via core::ptr::addr_eq

Source

pub fn clone(this: &Self) -> Self

Clones the RcuRef

Not implementing clone to not shadow the inner types clone impl

Source

pub fn get_root(this: &Self) -> &T

Get a reference to root of the RcuRef

i.e. the value that was stored in the Rcu before applying any mappings

Trait Implementations§

Source§

impl<T: ?Sized, M: ?Sized + Debug> Debug for RcuRef<T, M>

Source§

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

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

impl<T: ?Sized, M: ?Sized> Deref for RcuRef<T, M>

Source§

type Target = M

The resulting type after dereferencing.
Source§

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

Dereferences the value.

Auto Trait Implementations§

§

impl<T, M> Freeze for RcuRef<T, M>
where T: ?Sized, M: ?Sized,

§

impl<T, M> RefUnwindSafe for RcuRef<T, M>

§

impl<T, M> !Send for RcuRef<T, M>

§

impl<T, M> !Sync for RcuRef<T, M>

§

impl<T, M> Unpin for RcuRef<T, M>
where T: ?Sized, M: ?Sized,

§

impl<T, M> UnwindSafe for RcuRef<T, M>

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> 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, 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.