struct UniqueArcUninit<T: ?Sized, A: Allocator> {
ptr: NonNull<ArcInner<T>>,
layout_for_value: Layout,
alloc: Option<A>,
}
Expand description
A unique owning pointer to an ArcInner
that does not imply the contents are initialized,
but will deallocate it (without dropping the value) when dropped.
This is a helper for Arc::make_mut()
to ensure correct cleanup on panic.
Fields§
§ptr: NonNull<ArcInner<T>>
§layout_for_value: Layout
§alloc: Option<A>
Implementations§
Source§impl<T: ?Sized, A: Allocator> UniqueArcUninit<T, A>
impl<T: ?Sized, A: Allocator> UniqueArcUninit<T, A>
Sourcefn new(for_value: &T, alloc: A) -> UniqueArcUninit<T, A>
fn new(for_value: &T, alloc: A) -> UniqueArcUninit<T, A>
Allocates an ArcInner with layout suitable to contain for_value
or a clone of it.
Trait Implementations§
Auto Trait Implementations§
impl<T, A> Freeze for UniqueArcUninit<T, A>
impl<T, A> RefUnwindSafe for UniqueArcUninit<T, A>
impl<T, A> !Send for UniqueArcUninit<T, A>
impl<T, A> !Sync for UniqueArcUninit<T, A>
impl<T, A> Unpin for UniqueArcUninit<T, A>
impl<T, A> UnwindSafe for UniqueArcUninit<T, A>
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> SizedTypeProperties for T
impl<T> SizedTypeProperties for T
Source§#[doc(hidden)] const IS_ZST: bool = _
#[doc(hidden)] const IS_ZST: bool = _
🔬This is a nightly-only experimental API. (
sized_type_properties
)Source§#[doc(hidden)] const LAYOUT: Layout = _
#[doc(hidden)] const LAYOUT: Layout = _
🔬This is a nightly-only experimental API. (
sized_type_properties
)Source§#[doc(hidden)] const MAX_SLICE_LEN: usize = _
#[doc(hidden)] const MAX_SLICE_LEN: usize = _
🔬This is a nightly-only experimental API. (
sized_type_properties
)The largest safe length for a
[Self]
. Read more