Struct elysees::ArcBorrow [−][src]
#[repr(transparent)]pub struct ArcBorrow<'a, T: ?Sized + 'a> { /* fields omitted */ }
Expand description
A “borrowed Arc
”. This is essentially a reference to an ArcInner<T>
This is equivalent in guarantees to &Arc<T>
, however it has the same representation as an Arc<T>
, minimizing pointer-chasing.
ArcBorrow
lets us deal with borrows of known-refcounted objects
without needing to worry about where the Arc<T>
is.
Implementations
Compare two ArcBorrow
s via pointer equality. Will only return
true if they come from the same allocation
Similar to deref, but uses the lifetime 'a
rather than the lifetime of
self
, which is incompatible with the signature of the Deref
trait.
Borrow this as an ArcRef
. This does not bump the refcount.
Gets the number of Arc
pointers to this allocation, with a given load ordering
Trait Implementations
This method returns an ordering between self
and other
values if one exists. Read more
This method tests less than (for self
and other
) and is used by the <
operator. Read more
This method tests less than or equal to (for self
and other
) and is used by the <=
operator. Read more
This method tests greater than (for self
and other
) and is used by the >
operator. Read more
Auto Trait Implementations
impl<'a, T: ?Sized> RefUnwindSafe for ArcBorrow<'a, T> where
T: RefUnwindSafe,
impl<'a, T: ?Sized> UnwindSafe for ArcBorrow<'a, T> where
T: RefUnwindSafe,
Blanket Implementations
Mutably borrows from an owned value. Read more