Struct xpcom::interfaces::nsIWebSocketListener
[−]
[src]
#[repr(C)]pub struct nsIWebSocketListener { /* fields omitted */ }
interface nsIWebSocketListener : nsISupports
/**
* nsIWebSocketListener: passed to nsIWebSocketChannel::AsyncOpen. Receives
* websocket traffic events as they arrive.
*/
Methods
impl nsIWebSocketListener
[src]
pub fn coerce<T: nsIWebSocketListenerCoerce>(&self) -> &T
[src]
Cast this nsIWebSocketListener
to one of its base interfaces.
impl nsIWebSocketListener
[src]
pub unsafe fn OnStart(&self, aContext: *const nsISupports) -> nsresult
[src]
/**
* Called to signify the establishment of the message stream.
*
* Unlike most other networking channels (which use nsIRequestObserver
* instead of this class), we do not guarantee that OnStart is always
* called: OnStop is called without calling this function if errors occur
* during connection setup. If the websocket connection is successful,
* OnStart will be called before any other calls to this API.
*
* @param aContext user defined context
*/
[must_use] void onStart (in nsISupports aContext);
pub unsafe fn OnStop(
&self,
aContext: *const nsISupports,
aStatusCode: nsresult
) -> nsresult
[src]
&self,
aContext: *const nsISupports,
aStatusCode: nsresult
) -> nsresult
/**
* Called to signify the completion of the message stream.
* OnStop is the final notification the listener will receive and it
* completes the WebSocket connection: after it returns the
* nsIWebSocketChannel will release its reference to the listener.
*
* Note: this event can be received in error cases even if
* nsIWebSocketChannel::Close() has not been called.
*
* @param aContext user defined context
* @param aStatusCode reason for stopping (NS_OK if completed successfully)
*/
[must_use] void onStop (in nsISupports aContext, in nsresult aStatusCode);
pub unsafe fn OnMessageAvailable(
&self,
aContext: *const nsISupports,
aMsg: &nsACString
) -> nsresult
[src]
&self,
aContext: *const nsISupports,
aMsg: &nsACString
) -> nsresult
/**
* Called to deliver text message.
*
* @param aContext user defined context
* @param aMsg the message data
*/
[must_use] void onMessageAvailable (in nsISupports aContext, in AUTF8String aMsg);
pub unsafe fn OnBinaryMessageAvailable(
&self,
aContext: *const nsISupports,
aMsg: &nsACString
) -> nsresult
[src]
&self,
aContext: *const nsISupports,
aMsg: &nsACString
) -> nsresult
/**
* Called to deliver binary message.
*
* @param aContext user defined context
* @param aMsg the message data
*/
[must_use] void onBinaryMessageAvailable (in nsISupports aContext, in ACString aMsg);
pub unsafe fn OnAcknowledge(
&self,
aContext: *const nsISupports,
aSize: uint32_t
) -> nsresult
[src]
&self,
aContext: *const nsISupports,
aSize: uint32_t
) -> nsresult
/**
* Called to acknowledge message sent via sendMsg() or sendBinaryMsg.
*
* @param aContext user defined context
* @param aSize number of bytes placed in OS send buffer
*/
[must_use] void onAcknowledge (in nsISupports aContext, in uint32_t aSize);
pub unsafe fn OnServerClose(
&self,
aContext: *const nsISupports,
aCode: uint16_t,
aReason: &nsACString
) -> nsresult
[src]
&self,
aContext: *const nsISupports,
aCode: uint16_t,
aReason: &nsACString
) -> nsresult
/**
* Called to inform receipt of WebSocket Close message from server.
* In the case of errors onStop() can be called without ever
* receiving server close.
*
* No additional messages through onMessageAvailable(),
* onBinaryMessageAvailable() or onAcknowledge() will be delievered
* to the listener after onServerClose(), though outgoing messages can still
* be sent through the nsIWebSocketChannel connection.
*
* @param aContext user defined context
* @param aCode the websocket closing handshake close code.
* @param aReason the websocket closing handshake close reason
*/
[must_use] void onServerClose (in nsISupports aContext, in unsigned short aCode, in AUTF8String aReason);
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 nsIWebSocketListener
[src]
const IID: nsIID
IID: nsIID = nsID(3612120754, 26035, 20025, [158, 57, 197, 119, 222, 93, 122, 115])
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 nsIWebSocketListener
[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 nsIWebSocketListener
[src]
type Target = nsISupports
The resulting type after dereferencing.
fn deref(&self) -> &nsISupports
[src]
Dereferences the value.