pub struct Ref<T> { /* private fields */ }
Expand description
An alias for a referenced pointer
Implementations§
source§impl<T> Ref<T>
impl<T> Ref<T>
sourcepub fn consume(self) -> Arc<T>
pub fn consume(self) -> Arc<T>
Consume this Ref wrapper to yield the underlying Arc<T>
If you want to take ownership of the underlying type data, and
you can prove that only one strong-reference Arc exists to
this type, you can use std::arc::Arc::try_unwrap()
to peel
the reference counter and take exclusive ownership.
Trait Implementations§
Auto Trait Implementations§
impl<T> RefUnwindSafe for Ref<T>where
T: RefUnwindSafe,
impl<T> !Send for Ref<T>
impl<T> !Sync for Ref<T>
impl<T> Unpin for Ref<T>
impl<T> UnwindSafe for Ref<T>where
T: RefUnwindSafe,
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