pub struct Arc<T: ?Sized, Owner: ?Sized = dyn Destruct + Send + Sync> { /* private fields */ }Expand description
A projecting version of
Arc
which allows owning a containing struct but referencing a field.
Implementations§
Source§impl<T: ?Sized, Owner: ?Sized> Arc<T, Owner>
impl<T: ?Sized, Owner: ?Sized> Arc<T, Owner>
Sourcepub fn downgrade(this: &Self) -> Weak<T, Owner>
pub fn downgrade(this: &Self) -> Weak<T, Owner>
Creates a new Weak pointer to this projected field.
Sourcepub fn owner(this: &Self) -> Arc<Owner>
pub fn owner(this: &Self) -> Arc<Owner>
Gets a reference to the owning allocation.
This returns a clone of the owning
Arc,
so it cannot return a unique reference. If you want to take
unique ownership, use into_owner instead.
Sourcepub fn into_owner(this: Self) -> Arc<Owner>
pub fn into_owner(this: Self) -> Arc<Owner>
Consumes this projected field and returns the owning allocation.
Source§impl<T: ?Sized, Owner: ?Sized> Arc<T, Owner>
impl<T: ?Sized, Owner: ?Sized> Arc<T, Owner>
Sourcepub fn unsize<U: ?Sized, F>(
this: Self,
with: Coercion<T, U, F>,
) -> Arc<U, Owner>
Available on crate feature unsize only.
pub fn unsize<U: ?Sized, F>( this: Self, with: Coercion<T, U, F>, ) -> Arc<U, Owner>
unsize only.Convert this pointer with an unsizing coercion
(e.g. from T to dyn Trait or [T; N] to [T]).
Sourcepub fn unsize_owner<Pwner: ?Sized, F>(
this: Self,
with: Coercion<Owner, Pwner, F>,
) -> Arc<T, Pwner>
Available on crate feature unsize only.
pub fn unsize_owner<Pwner: ?Sized, F>( this: Self, with: Coercion<Owner, Pwner, F>, ) -> Arc<T, Pwner>
unsize only.Convert this pointer with an unsizing coercion of the owner
(e.g. from T to dyn Trait or [T; N] to [T]).
Trait Implementations§
Source§impl<T, U: ?Sized, Owner: ?Sized> CoerciblePtr<U> for Arc<T, Owner>
Available on crate feature unsize only.
impl<T, U: ?Sized, Owner: ?Sized> CoerciblePtr<U> for Arc<T, Owner>
Available on crate feature
unsize only.Source§fn as_sized_ptr(&mut self) -> *mut Self::Pointee
fn as_sized_ptr(&mut self) -> *mut Self::Pointee
Get the raw inner pointer.
Source§impl<T, Owner: ?Sized> Error for Arc<T, Owner>
Available on crate feature std only.
impl<T, Owner: ?Sized> Error for Arc<T, Owner>
Available on crate feature
std only.Source§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
Returns the lower-level source of this error, if any. Read more
1.0.0 · Source§fn description(&self) -> &str
fn description(&self) -> &str
👎Deprecated since 1.42.0: use the Display impl or to_string()
Source§impl<'a, T: ?Sized, Owner: 'a + Send> From<Arc<T, Owner>> for Arc<T, dyn Destruct + Send + 'a>
impl<'a, T: ?Sized, Owner: 'a + Send> From<Arc<T, Owner>> for Arc<T, dyn Destruct + Send + 'a>
Source§impl<'a, T: ?Sized, Owner: 'a + Send + Sync> From<Arc<T, Owner>> for Arc<T, dyn Destruct + Send + Sync + 'a>
impl<'a, T: ?Sized, Owner: 'a + Send + Sync> From<Arc<T, Owner>> for Arc<T, dyn Destruct + Send + Sync + 'a>
Source§impl<T, Owner: ?Sized> Ord for Arc<T, Owner>
impl<T, Owner: ?Sized> Ord for Arc<T, Owner>
Source§impl<T, Owner: ?Sized> PartialOrd for Arc<T, Owner>where
T: PartialOrd + ?Sized,
impl<T, Owner: ?Sized> PartialOrd for Arc<T, Owner>where
T: PartialOrd + ?Sized,
impl<T, Owner: ?Sized> Eq for Arc<T, Owner>
impl<T: ?Sized, Owner: ?Sized> Send for Arc<T, Owner>
impl<T: ?Sized, Owner: ?Sized> Sync for Arc<T, Owner>
impl<T: ?Sized, Owner: ?Sized> UnwindSafe for Arc<T, Owner>
Available on crate feature
std only.Auto Trait Implementations§
impl<T, Owner> Freeze for Arc<T, Owner>
impl<T, Owner> RefUnwindSafe for Arc<T, Owner>
impl<T, Owner> Unpin for Arc<T, Owner>
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