Struct xpcom::interfaces::nsIEventTarget
[−]
[src]
#[repr(C)]pub struct nsIEventTarget { /* fields omitted */ }
interface nsIEventTarget : nsISupports
Methods
impl nsIEventTarget
[src]
pub fn coerce<T: nsIEventTargetCoerce>(&self) -> &T
[src]
Cast this nsIEventTarget
to one of its base interfaces.
impl nsIEventTarget
[src]
pub const DISPATCH_NORMAL: i64
DISPATCH_NORMAL: i64 = 0
/**
* This flag specifies the default mode of event dispatch, whereby the event
* is simply queued for later processing. When this flag is specified,
* dispatch returns immediately after the event is queued.
*/
pub const DISPATCH_SYNC: i64
DISPATCH_SYNC: i64 = 1
/**
* This flag specifies the synchronous mode of event dispatch, in which the
* dispatch method does not return until the event has been processed.
*
* NOTE: passing this flag to dispatch may have the side-effect of causing
* other events on the current thread to be processed while waiting for the
* given event to be processed.
*/
pub const DISPATCH_AT_END: i64
DISPATCH_AT_END: i64 = 2
/**
* This flag specifies that the dispatch is occurring from a running event
* that was dispatched to the same event target, and that event is about to
* finish.
*
* A thread pool can use this as an optimization hint to not spin up
* another thread, since the current thread is about to become idle.
*
* These events are always async.
*/
pub unsafe fn IsOnCurrentThreadInfallible(&self) -> bool
[src]
/**
* IsOnCurrentThread() should return true if events dispatched to this target
* can possibly run on the current thread, and false otherwise. In the case
* of an nsIEventTarget for a thread pool, it should return true on all
* threads in the pool. In the case of a non-thread nsIEventTarget such as
* ThrottledEventQueue, it should return true on the thread where events are
* expected to be processed, even if no events from the queue are actually
* being processed right now.
*
* When called on an nsISerialEventTarget, IsOnCurrentThread can be used to
* ensure that no other thread has "ownership" of the event target. As such,
* it's useful for asserting that an object is only used on a particular
* thread. IsOnCurrentThread can't guarantee that the current event has been
* dispatched through a particular event target.
*
* The infallible version of IsOnCurrentThread() is optimized to avoid a
* virtual call for non-thread event targets. Thread targets should set
* mVirtualThread to their virtual PRThread. Non-thread targets should leave
* mVirtualThread null and implement IsOnCurrentThreadInfallible() to
* return the correct answer.
*
* The fallible version of IsOnCurrentThread may return errors, such as during
* shutdown. If it does not return an error, it should return the same result
* as the infallible version. The infallible method should return the correct
* result regardless of whether the fallible method returns an error.
*/
[noscript,notxpcom] boolean isOnCurrentThreadInfallible ();
pub unsafe fn IsOnCurrentThread(&self, _retval: *mut bool) -> nsresult
[src]
boolean isOnCurrentThread ();
pub unsafe fn DispatchFromScript(
&self,
event: *const nsIRunnable,
flags: uint32_t
) -> nsresult
[src]
&self,
event: *const nsIRunnable,
flags: uint32_t
) -> nsresult
/**
* Version of Dispatch to expose to JS, which doesn't require an alreadyAddRefed<>
* (it will be converted to that internally)
*
* @param event
* The (raw) event to dispatch.
* @param flags
* The flags modifying event dispatch. The flags are described in detail
* below.
*
* @throws NS_ERROR_INVALID_ARG
* Indicates that event is null.
* @throws NS_ERROR_UNEXPECTED
* Indicates that the thread is shutting down and has finished processing
* events, so this event would never run and has not been dispatched.
*/
[binaryname(DispatchFromScript)] void dispatch (in nsIRunnable event, in unsigned long flags);
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 nsIEventTarget
[src]
const IID: nsIID
IID: nsIID = nsID(2688256867, 44939, 16740, [176, 229, 196, 30, 139, 43, 124, 250])
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 nsIEventTarget
[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 nsIEventTarget
[src]
type Target = nsISupports
The resulting type after dereferencing.
fn deref(&self) -> &nsISupports
[src]
Dereferences the value.