[−][src]Struct rc_borrow::RcBorrow
Borrowed version of Rc
.
This type is guaranteed to have the same repr as &T
.
Implementations
impl<'a, T: ?Sized> RcBorrow<'a, T>
[src]
pub fn upgrade(this: Self) -> Rc<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 RcBorrow
from a raw pointer.
The raw pointer must have been previously returned by a call to
RcBorrow<U>::into_raw
or Rc<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 RcBorrow<'_, T> where
T: AsRef<U>,
[src]
T: AsRef<U>,
impl<'_, T: ?Sized> Binary for RcBorrow<'_, T> where
T: Binary,
[src]
T: Binary,
impl<'_, T: ?Sized> Borrow<T> for RcBorrow<'_, T>
[src]
impl<'_, T: ?Sized> Clone for RcBorrow<'_, T>
[src]
fn clone(&self) -> Self
[src]
fn clone_from(&mut self, source: &Self)
1.0.0[src]
impl<'_, T: ?Sized> Copy for RcBorrow<'_, T>
[src]
impl<'_, T: ?Sized> Debug for RcBorrow<'_, T> where
T: Debug,
[src]
T: Debug,
impl<'_, T: ?Sized> Deref for RcBorrow<'_, T>
[src]
impl<'_, T: ?Sized> Display for RcBorrow<'_, T> where
T: Display,
[src]
T: Display,
impl<'_, T: ?Sized> Eq for RcBorrow<'_, T> where
T: Eq,
[src]
T: Eq,
impl<'_, T: ?Sized> ErasablePtr for RcBorrow<'_, T> where
T: Erasable,
[src]
T: Erasable,
impl<'a, T: ?Sized> From<&'a Rc<T>> for RcBorrow<'a, T>
[src]
impl<'_, T: ?Sized> Hash for RcBorrow<'_, T> where
T: Hash,
[src]
T: Hash,
fn hash<H: Hasher>(&self, state: &mut H)
[src]
fn hash_slice<H>(data: &[Self], state: &mut H) where
H: Hasher,
1.3.0[src]
H: Hasher,
impl<'_, T: ?Sized> LowerExp for RcBorrow<'_, T> where
T: LowerExp,
[src]
T: LowerExp,
impl<'_, T: ?Sized> LowerHex for RcBorrow<'_, T> where
T: LowerHex,
[src]
T: LowerHex,
impl<'_, T: ?Sized> Octal for RcBorrow<'_, T> where
T: Octal,
[src]
T: Octal,
impl<'_, T: Ord> Ord for RcBorrow<'_, T> where
T: Ord,
[src]
T: Ord,
fn cmp(&self, other: &Self) -> Ordering
[src]
#[must_use]fn max(self, other: Self) -> Self
1.21.0[src]
#[must_use]fn min(self, other: Self) -> Self
1.21.0[src]
#[must_use]fn clamp(self, min: Self, max: Self) -> Self
[src]
impl<'_, T: ?Sized, O> PartialEq<O> for RcBorrow<'_, T> where
O: Deref,
T: PartialEq<O::Target>,
[src]
O: Deref,
T: PartialEq<O::Target>,
impl<'_, T: ?Sized, O> PartialOrd<O> for RcBorrow<'_, T> where
O: Deref,
T: PartialOrd<O::Target>,
[src]
O: Deref,
T: PartialOrd<O::Target>,
fn partial_cmp(&self, other: &O) -> Option<Ordering>
[src]
#[must_use]fn lt(&self, other: &Rhs) -> bool
1.0.0[src]
#[must_use]fn le(&self, other: &Rhs) -> bool
1.0.0[src]
#[must_use]fn gt(&self, other: &Rhs) -> bool
1.0.0[src]
#[must_use]fn ge(&self, other: &Rhs) -> bool
1.0.0[src]
impl<'_, T: ?Sized> Pointer for RcBorrow<'_, T> where
T: Pointer,
[src]
T: Pointer,
impl<'a, T: ?Sized> Send for RcBorrow<'a, T> where
&'a Rc<T>: Send,
[src]
&'a Rc<T>: Send,
impl<'a, T: ?Sized> Sync for RcBorrow<'a, T> where
&'a Rc<T>: Sync,
[src]
&'a Rc<T>: Sync,
impl<'_, T: ?Sized> ToSocketAddrs for RcBorrow<'_, T> where
T: ToSocketAddrs,
[src]
T: ToSocketAddrs,
type Iter = T::Iter
Returned iterator over socket addresses which this type may correspond to. Read more
fn to_socket_addrs(&self) -> Result<T::Iter>
[src]
impl<'_, T: ?Sized> Unpin for RcBorrow<'_, T>
[src]
impl<'_, T: ?Sized> UnwindSafe for RcBorrow<'_, T> where
T: RefUnwindSafe,
[src]
T: RefUnwindSafe,
impl<'_, T: ?Sized> UpperExp for RcBorrow<'_, T> where
T: UpperExp,
[src]
T: UpperExp,
impl<'_, T: ?Sized> UpperHex for RcBorrow<'_, T> where
T: UpperHex,
[src]
T: UpperHex,
Auto Trait Implementations
impl<'a, T> !RefUnwindSafe for RcBorrow<'a, T>
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> Erasable for T
[src]
unsafe fn unerase(this: NonNull<Erased>) -> NonNull<T>
[src]
const ACK_1_1_0: bool
[src]
fn erase(this: NonNull<Self>) -> NonNull<Erased>
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
fn to_owned(&self) -> T
[src]
fn clone_into(&self, target: &mut T)
[src]
impl<T> ToString for T where
T: Display + ?Sized,
[src]
T: Display + ?Sized,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,