pub struct ArcBorrow<'a, T: 'a>(/* private fields */);
Expand description
A “borrowed Arc”. This is a pointer to a T that is known to have been allocated within an Arc.
This is equivalent in guarantees to &Arc<T>
, however it is
a bit more flexible. To obtain an &Arc<T>
you must have
an Arc
However, Gecko hands us refcounted things as pointers to T directly, so we have to conjure up a temporary Arc on the stack each time. The same happens for when the object is managed by a RawOffsetArc.
ArcBorrow lets us deal with borrows of known-refcounted objects without needing to worry about how they’re actually stored.
Implementations§
Trait Implementations§
impl<'a, T> Copy for ArcBorrow<'a, T>
impl<'a, T: Eq + 'a> Eq for ArcBorrow<'a, T>
impl<'a, T: 'a> StructuralPartialEq for ArcBorrow<'a, T>
Auto Trait Implementations§
impl<'a, T> Freeze for ArcBorrow<'a, T>
impl<'a, T> RefUnwindSafe for ArcBorrow<'a, T>where
T: RefUnwindSafe,
impl<'a, T> Send for ArcBorrow<'a, T>where
T: Sync,
impl<'a, T> Sync for ArcBorrow<'a, T>where
T: Sync,
impl<'a, T> Unpin for ArcBorrow<'a, T>
impl<'a, T> UnwindSafe for ArcBorrow<'a, T>where
T: RefUnwindSafe,
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit
)