Struct intrusive_collections::UnsafeRef
source · pub struct UnsafeRef<T: ?Sized> { /* private fields */ }
Expand description
Unchecked shared pointer
This type acts like a Rc
or Arc
except that no reference count is
maintained. Instead, the user is responsible for freeing the managed object
once it is no longer in use.
You must guarantee that an object managed by an UnsafeRef
is not
moved, dropped or accessed through a mutable reference as long as at least
one UnsafeRef
is pointing to it.
Implementations§
source§impl<T: ?Sized> UnsafeRef<T>
impl<T: ?Sized> UnsafeRef<T>
sourcepub unsafe fn into_box(ptr: Self) -> Box<T>
pub unsafe fn into_box(ptr: Self) -> Box<T>
Converts an UnsafeRef
into a Box
§Safety
You must ensure that this is the only UnsafeRef
managing this
object and that it is not currently a member of any intrusive
collections. This operation is only valid if the UnsafeRef
was
created using UnsafeRef::from_box
.
Trait Implementations§
impl<T: ?Sized + Send + Sync> Send for UnsafeRef<T>
impl<T: ?Sized + Sync> Sync for UnsafeRef<T>
Auto Trait Implementations§
impl<T> Freeze for UnsafeRef<T>where
T: ?Sized,
impl<T> RefUnwindSafe for UnsafeRef<T>where
T: RefUnwindSafe + ?Sized,
impl<T> Unpin for UnsafeRef<T>where
T: ?Sized,
impl<T> UnwindSafe for UnsafeRef<T>where
T: RefUnwindSafe + ?Sized,
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
source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit
)