Struct intrusive_collections::UnsafeRef [] [src]

pub struct UnsafeRef<T: ?Sized> { /* fields omitted */ }

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.

Methods

impl<T: ?Sized> UnsafeRef<T>
[src]

Creates an UnsafeRef from a raw pointer

Safety

You must ensure that the UnsafeRef guarantees are upheld.

Converts an UnsafeRef into a raw pointer

impl<T: ?Sized> UnsafeRef<T>
[src]

Creates an UnsafeRef from a Box

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> Clone for UnsafeRef<T>
[src]

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

impl<T: ?Sized> Deref for UnsafeRef<T>
[src]

The resulting type after dereferencing

The method called to dereference a value

impl<T: ?Sized> AsRef<T> for UnsafeRef<T>
[src]

Performs the conversion.

impl<T: ?Sized> Borrow<T> for UnsafeRef<T>
[src]

Immutably borrows from an owned value. Read more

impl<T: Debug + ?Sized> Debug for UnsafeRef<T>
[src]

Formats the value using the given formatter.

impl<T: ?Sized + Sync> Send for UnsafeRef<T>
[src]

impl<T: ?Sized + Sync> Sync for UnsafeRef<T>
[src]

impl<T: ?Sized> IntrusivePointer<T> for UnsafeRef<T>
[src]

Consumes the owned pointer and returns a raw pointer to the owned object.

Constructs an owned pointer from a raw pointer which was previously returned by into_raw. Read more