#[repr(C)]pub struct RawOffsetArc<T: 'static> { /* private fields */ }
Expand description
An Arc, except it holds a pointer to the T instead of to the entire ArcInner.
Arc<T> RawOffsetArc<T>
| |
v v
---------------------
| RefCount | T (data) | [ArcInner<T>]
---------------------
This means that this is a direct pointer to
its contained data (and can be read from by both C++ and Rust),
but we can also convert it to a “regular” Arc
Implementations§
source§impl<T: 'static> RawOffsetArc<T>
impl<T: 'static> RawOffsetArc<T>
sourcepub fn with_arc<F, U>(&self, f: F) -> U
pub fn with_arc<F, U>(&self, f: F) -> U
Temporarily converts |self| into a bonafide Arc and exposes it to the provided callback. The refcount is not modified.
sourcepub fn make_mut(&mut self) -> &mut Twhere
T: Clone,
pub fn make_mut(&mut self) -> &mut Twhere
T: Clone,
If uniquely owned, provide a mutable reference Else create a copy, and mutate that
sourcepub fn borrow_arc<'a>(&'a self) -> ArcBorrow<'a, T>
pub fn borrow_arc<'a>(&'a self) -> ArcBorrow<'a, T>
Produce a pointer to the data that can be converted back to an arc
Trait Implementations§
source§impl<T: 'static> Clone for RawOffsetArc<T>
impl<T: 'static> Clone for RawOffsetArc<T>
source§impl<T: Debug + 'static> Debug for RawOffsetArc<T>
impl<T: Debug + 'static> Debug for RawOffsetArc<T>
source§impl<T: 'static> Deref for RawOffsetArc<T>
impl<T: 'static> Deref for RawOffsetArc<T>
source§impl<T: 'static> Drop for RawOffsetArc<T>
impl<T: 'static> Drop for RawOffsetArc<T>
source§impl<T: PartialEq> PartialEq for RawOffsetArc<T>
impl<T: PartialEq> PartialEq for RawOffsetArc<T>
source§fn eq(&self, other: &RawOffsetArc<T>) -> bool
fn eq(&self, other: &RawOffsetArc<T>) -> bool
Tests for
self
and other
values to be equal, and is used by ==
.source§fn ne(&self, other: &RawOffsetArc<T>) -> bool
fn ne(&self, other: &RawOffsetArc<T>) -> bool
Tests for
!=
. The default implementation is almost always sufficient,
and should not be overridden without very good reason.impl<T: Eq + 'static> Eq for RawOffsetArc<T>
impl<T: 'static + Sync + Send> Send for RawOffsetArc<T>
impl<T: 'static + Sync + Send> Sync for RawOffsetArc<T>
Auto Trait Implementations§
impl<T> Freeze for RawOffsetArc<T>
impl<T> RefUnwindSafe for RawOffsetArc<T>where
T: RefUnwindSafe,
impl<T> Unpin for RawOffsetArc<T>
impl<T> !UnwindSafe for RawOffsetArc<T>
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
)