pub struct ThinArc<Head, SliceItem> { /* private fields */ }Expand description
A thin version of Arc.
Implementations§
Source§impl<Head, SliceItem> ThinArc<Head, SliceItem>
impl<Head, SliceItem> ThinArc<Head, SliceItem>
Sourcepub unsafe fn from_erased(ptr: ErasedPtr) -> Self
pub unsafe fn from_erased(ptr: ErasedPtr) -> Self
Construct an owned pointer from an erased pointer.
§Safety
This pointer must logically own a valid instance of Self.
Source§impl<Head, SliceItem> ThinArc<Head, SliceItem>
impl<Head, SliceItem> ThinArc<Head, SliceItem>
Sourcepub fn new<I>(head: Head, slice: I) -> Self
pub fn new<I>(head: Head, slice: I) -> Self
Create a new atomically reference counted ThinData with the given head and slice.
§Panics
Panics if the slice iterator incorrectly reports its length.
§Note on allocation
This currently creates a ThinBox first and then moves that into an Arc.
This is required, because the heap layout of Arc is not stable,
and custom DSTs need to be manually allocated.
This will be eliminated in the future if/when the reference counted heap layout is stabilized.
Trait Implementations§
Source§impl<Head, SliceItem> PartialEq<Arc<ThinData<Head, SliceItem>>> for ThinArc<Head, SliceItem>
impl<Head, SliceItem> PartialEq<Arc<ThinData<Head, SliceItem>>> for ThinArc<Head, SliceItem>
impl<Head, SliceItem> Eq for ThinArc<Head, SliceItem>
impl<Head, SliceItem> Send for ThinArc<Head, SliceItem>
impl<Head, SliceItem> Sync for ThinArc<Head, SliceItem>
Auto Trait Implementations§
impl<Head, SliceItem> Freeze for ThinArc<Head, SliceItem>
impl<Head, SliceItem> RefUnwindSafe for ThinArc<Head, SliceItem>where
Head: RefUnwindSafe,
SliceItem: RefUnwindSafe,
impl<Head, SliceItem> Unpin for ThinArc<Head, SliceItem>
impl<Head, SliceItem> UnwindSafe for ThinArc<Head, SliceItem>where
Head: RefUnwindSafe,
SliceItem: 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