[][src]Struct rc_borrow::ArcBorrow

#[repr(transparent)]pub struct ArcBorrow<'a, T: ?Sized> { /* fields omitted */ }

Borrowed version of Arc.

This type is guaranteed to have the same repr as &T.

Implementations

impl<'a, T: ?Sized> ArcBorrow<'a, T>[src]

pub fn upgrade(this: Self) -> Arc<T>[src]

Convert this borrowed pointer into an owned pointer.

pub fn to_weak(this: Self) -> Weak<T>[src]

Convert this borrowed pointer into a weak pointer.

pub fn downgrade(this: Self) -> &'a T[src]

Convert this borrowed pointer into a standard reference.

This gives you a long-lived reference, whereas dereferencing gives a temporary borrow.

pub fn strong_count(this: Self) -> usize[src]

Get the number of strong owning pointers to this allocation.

pub fn weak_count(this: Self) -> usize[src]

Get the number of weak owning pointers to this allocation.

pub fn into_raw(this: Self) -> *const T[src]

Get a raw pointer that can be used with from_raw.

pub unsafe fn from_raw(ptr: *const T) -> Self[src]

Construct a new ArcBorrow from a raw pointer.

The raw pointer must have been previously returned by a call to ArcBorrow<U>::into_raw or Arc<U>::as_raw where U must have the same size and alignment as T. This is trivially true if U is T. Note that if U is not T, this is a pointer cast (transmute) between the two types, and the types must be transmute-compatible.

Trait Implementations

impl<'_, T: ?Sized, U: ?Sized> AsRef<U> for ArcBorrow<'_, T> where
    T: AsRef<U>, 
[src]

impl<'_, T: ?Sized> Binary for ArcBorrow<'_, T> where
    T: Binary
[src]

impl<'_, T: ?Sized> Borrow<T> for ArcBorrow<'_, T>[src]

impl<'_, T: ?Sized> Clone for ArcBorrow<'_, T>[src]

impl<'_, T: ?Sized> Copy for ArcBorrow<'_, T>[src]

impl<'_, T: ?Sized> Debug for ArcBorrow<'_, T> where
    T: Debug
[src]

impl<'_, T: ?Sized> Deref for ArcBorrow<'_, T>[src]

type Target = T

The resulting type after dereferencing.

impl<'_, T: ?Sized> Display for ArcBorrow<'_, T> where
    T: Display
[src]

impl<'_, T: ?Sized> Eq for ArcBorrow<'_, T> where
    T: Eq
[src]

impl<'_, T: ?Sized> ErasablePtr for ArcBorrow<'_, T> where
    T: Erasable
[src]

impl<'a, T: ?Sized> From<&'a Arc<T>> for ArcBorrow<'a, T>[src]

impl<'_, T: ?Sized> Hash for ArcBorrow<'_, T> where
    T: Hash
[src]

impl<'_, T: ?Sized> LowerExp for ArcBorrow<'_, T> where
    T: LowerExp
[src]

impl<'_, T: ?Sized> LowerHex for ArcBorrow<'_, T> where
    T: LowerHex
[src]

impl<'_, T: ?Sized> Octal for ArcBorrow<'_, T> where
    T: Octal
[src]

impl<'_, T: Ord> Ord for ArcBorrow<'_, T> where
    T: Ord
[src]

impl<'_, T: ?Sized, O> PartialEq<O> for ArcBorrow<'_, T> where
    O: Deref,
    T: PartialEq<O::Target>, 
[src]

impl<'_, T: ?Sized, O> PartialOrd<O> for ArcBorrow<'_, T> where
    O: Deref,
    T: PartialOrd<O::Target>, 
[src]

impl<'_, T: ?Sized> Pointer for ArcBorrow<'_, T> where
    T: Pointer
[src]

impl<'a, T: ?Sized> Send for ArcBorrow<'a, T> where
    &'a Arc<T>: Send
[src]

impl<'a, T: ?Sized> Sync for ArcBorrow<'a, T> where
    &'a Arc<T>: Sync
[src]

impl<'_, T: ?Sized> ToSocketAddrs for ArcBorrow<'_, T> where
    T: ToSocketAddrs
[src]

type Iter = T::Iter

Returned iterator over socket addresses which this type may correspond to. Read more

impl<'_, T: ?Sized> Unpin for ArcBorrow<'_, T>[src]

impl<'_, T: ?Sized> UnwindSafe for ArcBorrow<'_, T> where
    T: RefUnwindSafe
[src]

impl<'_, T: ?Sized> UpperExp for ArcBorrow<'_, T> where
    T: UpperExp
[src]

impl<'_, T: ?Sized> UpperHex for ArcBorrow<'_, T> where
    T: UpperHex
[src]

Auto Trait Implementations

impl<'a, T: ?Sized> RefUnwindSafe for ArcBorrow<'a, T> where
    T: RefUnwindSafe

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> Erasable for T[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T> ToString for T where
    T: Display + ?Sized
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

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

The type returned in the event of a conversion error.