Struct xpcom::RefPtr
[−]
[src]
pub struct RefPtr<T: RefCounted + 'static> { /* fields omitted */ }
A smart pointer holding a RefCounted object. The object itself manages its own memory. RefPtr will invoke the addref and release methods at the appropriate times to facilitate the bookkeeping.
Methods
impl<T: RefCounted + 'static> RefPtr<T>
[src]
pub fn new(p: &T) -> RefPtr<T>
[src]
Construct a new RefPtr from a reference to the refcounted object.
pub unsafe fn from_raw(p: *const T) -> Option<RefPtr<T>>
[src]
Construct a RefPtr from a raw pointer, addrefing it.
pub unsafe fn from_raw_dont_addref(p: *const T) -> Option<RefPtr<T>>
[src]
Construct a RefPtr from a raw pointer, without addrefing it.
pub unsafe fn forget(self, into: &mut *const T)
[src]
Write this RefPtr's value into an outparameter.
Trait Implementations
impl<T: RefCounted + 'static> Deref for RefPtr<T>
[src]
type Target = T
The resulting type after dereferencing.
fn deref(&self) -> &T
[src]
Dereferences the value.