Struct xpcom::interfaces::nsIThreadObserver
[−]
[src]
#[repr(C)]pub struct nsIThreadObserver { /* fields omitted */ }
interface nsIThreadObserver : nsISupports
Methods
impl nsIThreadObserver
[src]
pub fn coerce<T: nsIThreadObserverCoerce>(&self) -> &T
[src]
Cast this nsIThreadObserver
to one of its base interfaces.
impl nsIThreadObserver
[src]
pub unsafe fn OnDispatchedEvent(&self) -> nsresult
[src]
/**
* This interface provides the observer with hooks to implement a layered
* event queue. For example, it is possible to overlay processing events
* for a GUI toolkit on top of the events for a thread:
*
* var NativeQueue;
* Observer = {
* onDispatchedEvent() {
* NativeQueue.signal();
* }
* onProcessNextEvent(thread, mayWait) {
* if (NativeQueue.hasNextEvent())
* NativeQueue.processNextEvent();
* while (mayWait && !thread.hasPendingEvent()) {
* NativeQueue.wait();
* NativeQueue.processNextEvent();
* }
* }
* };
*
* NOTE: The implementation of this interface must be threadsafe.
*
* NOTE: It is valid to change the thread's observer during a call to an
* observer method.
*
* NOTE: Will be split into two interfaces soon: one for onProcessNextEvent and
* afterProcessNextEvent, then another that inherits the first and adds
* onDispatchedEvent.
*/
/**
* This method is called after an event has been dispatched to the thread.
* This method may be called from any thread.
*/
void onDispatchedEvent ();
pub unsafe fn OnProcessNextEvent(
&self,
thread: *const nsIThreadInternal,
mayWait: bool
) -> nsresult
[src]
&self,
thread: *const nsIThreadInternal,
mayWait: bool
) -> nsresult
/**
* This method is called when nsIThread::ProcessNextEvent is called. It does
* not guarantee that an event is actually going to be processed. This method
* is only called on the target thread.
*
* @param thread
* The thread being asked to process another event.
* @param mayWait
* Indicates whether or not the method is allowed to block the calling
* thread. For example, this parameter is false during thread shutdown.
*/
void onProcessNextEvent (in nsIThreadInternal thread, in boolean mayWait);
pub unsafe fn AfterProcessNextEvent(
&self,
thread: *const nsIThreadInternal,
eventWasProcessed: bool
) -> nsresult
[src]
&self,
thread: *const nsIThreadInternal,
eventWasProcessed: bool
) -> nsresult
/**
* This method is called (from nsIThread::ProcessNextEvent) after an event
* is processed. It does not guarantee that an event was actually processed
* (depends on the value of |eventWasProcessed|. This method is only called
* on the target thread. DO NOT EVER RUN SCRIPT FROM THIS CALLBACK!!!
*
* @param thread
* The thread that processed another event.
* @param eventWasProcessed
* Indicates whether an event was actually processed. May be false if the
* |mayWait| flag was false when calling nsIThread::ProcessNextEvent().
*/
void afterProcessNextEvent (in nsIThreadInternal thread, in bool eventWasProcessed);
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 nsIThreadObserver
[src]
const IID: nsIID
IID: nsIID = nsID(3431833683, 6006, 17602, [145, 153, 181, 166, 41, 208, 161, 157])
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 nsIThreadObserver
[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 nsIThreadObserver
[src]
type Target = nsISupports
The resulting type after dereferencing.
fn deref(&self) -> &nsISupports
[src]
Dereferences the value.