ArcInner

Struct ArcInner 

Source
#[repr(C)]
pub struct ArcInner<T: ?Sized> { /* private fields */ }
Expand description

The object allocated by an Arc

Implementations§

Source§

impl<T> ArcInner<T>

Source

pub fn data_offset() -> usize

Get the offset of the data pointer from the beginning of the inner pointer

Source

pub unsafe fn data_ptr(this: *mut ArcInner<T>) -> *mut T

Given the inner pointer, get a data pointer

§Safety

This must be a pointer to a (potentially uninitialized) ArcInner

Source

pub unsafe fn from_data(data: *mut T) -> *mut ArcInner<T>

Given a data pointer, get the inner pointer

§Safety

This must be a pointer to the data field of a (potentially uninitialized) ArcInner with pointer provenance consisting of the entire ArcInner

Source§

impl<T: ?Sized> ArcInner<T>

Source

pub fn layout(data: &T) -> (Layout, usize)

Get the layout of an ArcInner<T> given the data, along with the data offset

Source

pub fn data_offset_value(data: &T) -> usize

Get the offset of the data pointer from the beginning of the inner pointer, given the data

Source

pub unsafe fn count_ptr(data: *mut T) -> *mut AtomicUsize

Given a data pointer, get the count pointer

§Safety

This must be a pointer to the data field of an initialized ArcInner with pointer provenance consisting of the entire ArcInner

Trait Implementations§

Source§

impl<S: SliceDst + ?Sized> SliceDst for ArcInner<S>

§Safety

ArcInner<S> is implemented as an additional header before S, consisting of the reference count

Source§

fn layout_for(len: usize) -> Layout

Get the layout of the slice-containing type with the given slice length.
Source§

fn retype(ptr: NonNull<[()]>) -> NonNull<Self>

Add the type onto an untyped pointer. Read more
Source§

impl<T: ?Sized + Sync + Send> Send for ArcInner<T>

Source§

impl<T: ?Sized + Sync + Send> Sync for ArcInner<T>

Auto Trait Implementations§

§

impl<T> !Freeze for ArcInner<T>

§

impl<T> RefUnwindSafe for ArcInner<T>
where T: RefUnwindSafe + ?Sized,

§

impl<T> Unpin for ArcInner<T>
where T: Unpin + ?Sized,

§

impl<T> UnwindSafe for ArcInner<T>
where T: UnwindSafe + ?Sized,

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> Erasable for T

Source§

const ACK_1_1_0: bool = true

Whether this implementor has acknowledged the 1.1.0 update to unerase’s documented implementation requirements. Read more
Source§

unsafe fn unerase(this: NonNull<Erased>) -> NonNull<T>

Unerase this erased pointer. Read more
Source§

fn erase(this: NonNull<Self>) -> NonNull<Erased>

Turn this erasable pointer into an erased pointer. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.