[−][src]Struct intrusive_collections::UnsafeRef
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
impl<T: ?Sized> UnsafeRef<T>
[src]
pub unsafe fn from_raw(val: *const T) -> UnsafeRef<T>
[src]
Creates an UnsafeRef
from a raw pointer
Safety
You must ensure that the UnsafeRef
guarantees are upheld.
pub fn into_raw(ptr: Self) -> *mut T
[src]
Converts an UnsafeRef
into a raw pointer
impl<T: ?Sized> UnsafeRef<T>
[src]
pub fn from_box(val: Box<T>) -> UnsafeRef<T>
[src]
Creates an UnsafeRef
from a Box
pub unsafe fn into_box(ptr: Self) -> Box<T>
[src]
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> AsRef<T> for UnsafeRef<T>
[src]
impl<T: ?Sized> Borrow<T> for UnsafeRef<T>
[src]
impl<T: ?Sized> Clone for UnsafeRef<T>
[src]
fn clone(&self) -> UnsafeRef<T>
[src]
fn clone_from(&mut self, source: &Self)
1.0.0[src]
impl<T: Debug + ?Sized> Debug for UnsafeRef<T>
[src]
impl<T: ?Sized> Deref for UnsafeRef<T>
[src]
impl<T: ?Sized + Send> Send for UnsafeRef<T>
[src]
impl<T: ?Sized + Sync> Sync for UnsafeRef<T>
[src]
Auto Trait Implementations
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> 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, 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>,