Struct intrusive_collections::IntrusiveRef
[−]
[src]
pub struct IntrusiveRef<T: ?Sized> { // some fields omitted }
Pointer to an object that may be part of one or more intrusive colllections
This pointer guarantees that an object managed by an IntrusiveRef
is not
moved, dropped or accessed through a mutable reference as long as at least
one IntrusiveRef
is pointing to it.
Methods
impl<T: ?Sized> IntrusiveRef<T>
[src]
unsafe fn from_raw(val: *mut T) -> IntrusiveRef<T>
Creates an IntrusiveRef
from a raw pointer
Safety
You must ensure that the IntrusiveRef
guarantees are upheld.
unsafe fn as_mut(&mut self) -> &mut T
Creates an IntrusiveRef
from a raw pointer
Safety
This yields a &mut
reference but makes no guarantee that these
references are not aliased. You must ensure that there are no live
references (mutable or immutable) to this object.
fn into_raw(self) -> *mut T
Converts an IntrusiveRef
into a raw pointer
impl<T: ?Sized> IntrusiveRef<T>
[src]
fn from_box(val: Box<T>) -> IntrusiveRef<T>
Creates an IntrusiveRef
from a Box
unsafe fn into_box(self) -> Box<T>
Converts an IntrusiveRef
into a Box
Safety
You must ensure that this is the only IntrusiveRef
managing this
object and that it is not currently a member of any intrusive
collections. This operation is only valid if the IntrusiveRef
was
created using IntrusiveRef::from_box
.
Trait Implementations
impl<T: ?Sized> Copy for IntrusiveRef<T>
[src]
impl<T: ?Sized> Clone for IntrusiveRef<T>
[src]
fn clone(&self) -> IntrusiveRef<T>
Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)
1.0.0
Performs copy-assignment from source
. Read more
impl<T: ?Sized> Deref for IntrusiveRef<T>
[src]
type Target = T
The resulting type after dereferencing
fn deref(&self) -> &T
The method called to dereference a value
impl<T: ?Sized> AsRef<T> for IntrusiveRef<T>
[src]
fn as_ref(&self) -> &T
Performs the conversion.