Struct xpcom::interfaces::nsIWeakReference
[−]
[src]
#[repr(C)]pub struct nsIWeakReference { /* fields omitted */ }
interface nsIWeakReference : nsISupports
/**
* An instance of |nsIWeakReference| is a proxy object that cooperates with
* its referent to give clients a non-owning, non-dangling reference. Clients
* own the proxy, and should generally manage it with an |nsCOMPtr| (see the
* type |nsWeakPtr| for a |typedef| name that stands out) as they would any
* other XPCOM object. The |QueryReferent| member function provides a
* (hopefully short-lived) owning reference on demand, through which clients
* can get useful access to the referent, while it still exists.
*
* @version 1.0
* @see nsISupportsWeakReference
* @see nsWeakReference
* @see nsWeakPtr
*/
Methods
impl nsIWeakReference
[src]
pub fn coerce<T: nsIWeakReferenceCoerce>(&self) -> &T
[src]
Cast this nsIWeakReference
to one of its base interfaces.
impl nsIWeakReference
[src]
pub unsafe fn QueryReferentFromScript(
&self,
uuid: &nsIID,
result: *mut *mut c_void
) -> nsresult
[src]
&self,
uuid: &nsIID,
result: *mut *mut c_void
) -> nsresult
/**
* |QueryReferent| queries the referent, if it exists, and like |QueryInterface|, produces
* an owning reference to the desired interface. It is designed to look and act exactly
* like (a proxied) |QueryInterface|. Don't hold on to the produced interface permanently;
* that would defeat the purpose of using a non-owning |nsIWeakReference| in the first place.
*/
[binaryname(QueryReferentFromScript)] void QueryReferent (in nsIIDRef uuid, [iid_is (uuid), retval] out nsQIResult result);
Methods from Deref<Target = nsISupports>
pub fn coerce<T: nsISupportsCoerce>(&self) -> &T
[src]
Cast this nsISupports
to one of its base interfaces.
pub unsafe fn QueryInterface(
&self,
uuid: &nsIID,
result: *mut *mut c_void
) -> nsresult
[src]
&self,
uuid: &nsIID,
result: *mut *mut c_void
) -> nsresult
void QueryInterface (in nsIIDRef uuid, [iid_is (uuid), retval] out nsQIResult result);
pub unsafe fn AddRef(&self) -> nsrefcnt
[src]
[noscript,notxpcom] nsrefcnt AddRef ();
pub unsafe fn Release(&self) -> nsrefcnt
[src]
[noscript,notxpcom] nsrefcnt Release ();
Trait Implementations
impl XpCom for nsIWeakReference
[src]
const IID: nsIID
IID: nsIID = nsID(2441657477, 63790, 4562, [129, 239, 0, 96, 8, 58, 11, 207])
fn query_interface<T: XpCom>(&self) -> Option<RefPtr<T>>
[src]
Perform a QueryInterface call on this object, attempting to dynamically cast it to the requested interface type. Returns Some(RefPtr) if the cast succeeded, and None otherwise. Read more
impl RefCounted for nsIWeakReference
[src]
unsafe fn addref(&self)
[src]
Increment the reference count.
unsafe fn release(&self)
[src]
Decrement the reference count, potentially freeing backing memory.
impl Deref for nsIWeakReference
[src]
type Target = nsISupports
The resulting type after dereferencing.
fn deref(&self) -> &nsISupports
[src]
Dereferences the value.