Struct xpcom::interfaces::nsIWebSocketChannel
[−]
[src]
#[repr(C)]pub struct nsIWebSocketChannel { /* fields omitted */ }
interface nsIWebSocketChannel : nsISupports
/**
* Low-level websocket API: handles network protocol.
*
* This is primarly intended for use by the higher-level nsIWebSocket.idl.
* We are also making it scriptable for now, but this may change once we have
* WebSockets for Workers.
*/
Methods
impl nsIWebSocketChannel
[src]
pub fn coerce<T: nsIWebSocketChannelCoerce>(&self) -> &T
[src]
Cast this nsIWebSocketChannel
to one of its base interfaces.
impl nsIWebSocketChannel
[src]
pub const CLOSE_NORMAL: i64
CLOSE_NORMAL: i64 = 1000
pub const CLOSE_GOING_AWAY: i64
CLOSE_GOING_AWAY: i64 = 1001
pub const CLOSE_PROTOCOL_ERROR: i64
CLOSE_PROTOCOL_ERROR: i64 = 1002
pub const CLOSE_UNSUPPORTED_DATATYPE: i64
CLOSE_UNSUPPORTED_DATATYPE: i64 = 1003
pub const CLOSE_NO_STATUS: i64
CLOSE_NO_STATUS: i64 = 1005
pub const CLOSE_ABNORMAL: i64
CLOSE_ABNORMAL: i64 = 1006
pub const CLOSE_INVALID_PAYLOAD: i64
CLOSE_INVALID_PAYLOAD: i64 = 1007
pub const CLOSE_POLICY_VIOLATION: i64
CLOSE_POLICY_VIOLATION: i64 = 1008
pub const CLOSE_TOO_LARGE: i64
CLOSE_TOO_LARGE: i64 = 1009
pub const CLOSE_EXTENSION_MISSING: i64
CLOSE_EXTENSION_MISSING: i64 = 1010
pub const CLOSE_INTERNAL_ERROR: i64
CLOSE_INTERNAL_ERROR: i64 = 1011
pub const CLOSE_TLS_FAILED: i64
CLOSE_TLS_FAILED: i64 = 1015
pub unsafe fn GetOriginalURI(
&self,
aOriginalURI: *mut *const nsIURI
) -> nsresult
[src]
&self,
aOriginalURI: *mut *const nsIURI
) -> nsresult
/**
* The original URI used to construct the protocol connection. This is used
* in the case of a redirect or URI "resolution" (e.g. resolving a
* resource: URI to a file: URI) so that the original pre-redirect
* URI can still be obtained. This is never null.
*/
[must_use] readonly attribute nsIURI originalURI;
pub unsafe fn GetURI(&self, aURI: *mut *const nsIURI) -> nsresult
[src]
/**
* The readonly URI corresponding to the protocol connection after any
* redirections are completed.
*/
[must_use] readonly attribute nsIURI URI;
pub unsafe fn GetNotificationCallbacks(
&self,
aNotificationCallbacks: *mut *const nsIInterfaceRequestor
) -> nsresult
[src]
&self,
aNotificationCallbacks: *mut *const nsIInterfaceRequestor
) -> nsresult
/**
* The notification callbacks for authorization, etc..
*/
[must_use] attribute nsIInterfaceRequestor notificationCallbacks;
pub unsafe fn SetNotificationCallbacks(
&self,
aNotificationCallbacks: *const nsIInterfaceRequestor
) -> nsresult
[src]
&self,
aNotificationCallbacks: *const nsIInterfaceRequestor
) -> nsresult
/**
* The notification callbacks for authorization, etc..
*/
[must_use] attribute nsIInterfaceRequestor notificationCallbacks;
pub unsafe fn GetSecurityInfo(
&self,
aSecurityInfo: *mut *const nsISupports
) -> nsresult
[src]
&self,
aSecurityInfo: *mut *const nsISupports
) -> nsresult
/**
* Transport-level security information (if any)
*/
[must_use] readonly attribute nsISupports securityInfo;
pub unsafe fn GetLoadGroup(
&self,
aLoadGroup: *mut *const nsILoadGroup
) -> nsresult
[src]
&self,
aLoadGroup: *mut *const nsILoadGroup
) -> nsresult
/**
* The load group of of the websocket
*/
[must_use] attribute nsILoadGroup loadGroup;
pub unsafe fn SetLoadGroup(&self, aLoadGroup: *const nsILoadGroup) -> nsresult
[src]
/**
* The load group of of the websocket
*/
[must_use] attribute nsILoadGroup loadGroup;
pub unsafe fn GetLoadInfo(&self, aLoadInfo: *mut *const nsILoadInfo) -> nsresult
[src]
/**
* The load info of the websocket
*/
[must_use] attribute nsILoadInfo loadInfo;
pub unsafe fn SetLoadInfo(&self, aLoadInfo: *const nsILoadInfo) -> nsresult
[src]
/**
* The load info of the websocket
*/
[must_use] attribute nsILoadInfo loadInfo;
pub unsafe fn GetProtocol(&self, aProtocol: &mut nsACString) -> nsresult
[src]
/**
* Sec-Websocket-Protocol value
*/
[must_use] attribute ACString protocol;
pub unsafe fn SetProtocol(&self, aProtocol: &nsACString) -> nsresult
[src]
/**
* Sec-Websocket-Protocol value
*/
[must_use] attribute ACString protocol;
pub unsafe fn GetExtensions(&self, aExtensions: &mut nsACString) -> nsresult
[src]
/**
* Sec-Websocket-Extensions response header value
*/
[must_use] readonly attribute ACString extensions;
pub unsafe fn InitLoadInfo(
&self,
aLoadingNode: *const nsIDOMNode,
aLoadingPrincipal: *const nsIPrincipal,
aTriggeringPrincipal: *const nsIPrincipal,
aSecurityFlags: uint32_t,
aContentPolicyType: uint32_t
) -> nsresult
[src]
&self,
aLoadingNode: *const nsIDOMNode,
aLoadingPrincipal: *const nsIPrincipal,
aTriggeringPrincipal: *const nsIPrincipal,
aSecurityFlags: uint32_t,
aContentPolicyType: uint32_t
) -> nsresult
/**
* Init the WebSocketChannel with LoadInfo arguments.
* @param aLoadingNode
* @param aLoadingPrincipal
* @param aTriggeringPrincipal
* @param aSecurityFlags
* @param aContentPolicyType
* These will be used as values for the nsILoadInfo object on the
* created channel. For details, see nsILoadInfo in nsILoadInfo.idl
* @return reference to the new nsIChannel object
*
* Keep in mind that URIs coming from a webpage should *never* use the
* systemPrincipal as the loadingPrincipal.
*
* Please note, if you provide both a loadingNode and a loadingPrincipal,
* then loadingPrincipal must be equal to loadingNode->NodePrincipal().
* But less error prone is to just supply a loadingNode.
*/
[must_use] void initLoadInfo (in nsIDOMNode aLoadingNode, in nsIPrincipal aLoadingPrincipal, in nsIPrincipal aTriggeringPrincipal, in unsigned long aSecurityFlags, in unsigned long aContentPolicyType);
pub unsafe fn AsyncOpen(
&self,
aURI: *const nsIURI,
aOrigin: &nsACString,
aInnerWindowID: uint64_t,
aListener: *const nsIWebSocketListener,
aContext: *const nsISupports
) -> nsresult
[src]
&self,
aURI: *const nsIURI,
aOrigin: &nsACString,
aInnerWindowID: uint64_t,
aListener: *const nsIWebSocketListener,
aContext: *const nsISupports
) -> nsresult
/**
* Asynchronously open the websocket connection. Received messages are fed
* to the socket listener as they arrive. The socket listener's methods
* are called on the thread that calls asyncOpen and are not called until
* after asyncOpen returns. If asyncOpen returns successfully, the
* protocol implementation promises to call at least onStop on the listener.
*
* NOTE: Implementations should throw NS_ERROR_ALREADY_OPENED if the
* websocket connection is reopened.
*
* @param aURI the uri of the websocket protocol - may be redirected
* @param aOrigin the uri of the originating resource
* @param aInnerWindowID the inner window ID
* @param aListener the nsIWebSocketListener implementation
* @param aContext an opaque parameter forwarded to aListener's methods
*/
[must_use] void asyncOpen (in nsIURI aURI, in ACString aOrigin, in unsigned long long aInnerWindowID, in nsIWebSocketListener aListener, in nsISupports aContext);
pub unsafe fn Close(&self, aCode: uint16_t, aReason: &nsACString) -> nsresult
[src]
[must_use] void close (in unsigned short aCode, in AUTF8String aReason);
pub unsafe fn SendMsg(&self, aMsg: &nsACString) -> nsresult
[src]
/**
* Use to send text message down the connection to WebSocket peer.
*
* @param aMsg the utf8 string to send
*/
[must_use] void sendMsg (in AUTF8String aMsg);
pub unsafe fn SendBinaryMsg(&self, aMsg: &nsACString) -> nsresult
[src]
/**
* Use to send binary message down the connection to WebSocket peer.
*
* @param aMsg the data to send
*/
[must_use] void sendBinaryMsg (in ACString aMsg);
pub unsafe fn SendBinaryStream(
&self,
aStream: *const nsIInputStream,
length: uint32_t
) -> nsresult
[src]
&self,
aStream: *const nsIInputStream,
length: uint32_t
) -> nsresult
/**
* Use to send a binary stream (Blob) to Websocket peer.
*
* @param aStream The input stream to be sent.
*/
[must_use] void sendBinaryStream (in nsIInputStream aStream, in unsigned long length);
pub unsafe fn GetPingInterval(&self, aPingInterval: *mut uint32_t) -> nsresult
[src]
/**
* This value determines how often (in seconds) websocket keepalive
* pings are sent. If set to 0 (the default), no pings are ever sent.
*
* This value can currently only be set before asyncOpen is called, else
* NS_ERROR_IN_PROGRESS is thrown.
*
* Be careful using this setting: ping traffic can consume lots of power and
* bandwidth over time.
*/
[must_use] attribute unsigned long pingInterval;
pub unsafe fn SetPingInterval(&self, aPingInterval: uint32_t) -> nsresult
[src]
/**
* This value determines how often (in seconds) websocket keepalive
* pings are sent. If set to 0 (the default), no pings are ever sent.
*
* This value can currently only be set before asyncOpen is called, else
* NS_ERROR_IN_PROGRESS is thrown.
*
* Be careful using this setting: ping traffic can consume lots of power and
* bandwidth over time.
*/
[must_use] attribute unsigned long pingInterval;
pub unsafe fn GetPingTimeout(&self, aPingTimeout: *mut uint32_t) -> nsresult
[src]
/**
* This value determines how long (in seconds) the websocket waits for
* the server to reply to a ping that has been sent before considering the
* connection broken.
*
* This value can currently only be set before asyncOpen is called, else
* NS_ERROR_IN_PROGRESS is thrown.
*/
[must_use] attribute unsigned long pingTimeout;
pub unsafe fn SetPingTimeout(&self, aPingTimeout: uint32_t) -> nsresult
[src]
/**
* This value determines how long (in seconds) the websocket waits for
* the server to reply to a ping that has been sent before considering the
* connection broken.
*
* This value can currently only be set before asyncOpen is called, else
* NS_ERROR_IN_PROGRESS is thrown.
*/
[must_use] attribute unsigned long pingTimeout;
pub unsafe fn GetSerial(&self, aSerial: *mut uint32_t) -> nsresult
[src]
/**
* Unique ID for this channel. It's not readonly because when the channel is
* created via IPC, the serial number is received from the child process.
*/
[must_use] attribute unsigned long serial;
pub unsafe fn SetSerial(&self, aSerial: uint32_t) -> nsresult
[src]
/**
* Unique ID for this channel. It's not readonly because when the channel is
* created via IPC, the serial number is received from the child process.
*/
[must_use] attribute unsigned long serial;
pub unsafe fn SetServerParameters(
&self,
aProvider: *const nsITransportProvider,
aNegotiatedExtensions: &nsACString
) -> nsresult
[src]
&self,
aProvider: *const nsITransportProvider,
aNegotiatedExtensions: &nsACString
) -> nsresult
/**
* Set a nsITransportProvider and negotated extensions to be used by this
* channel. Calling this function also means that this channel will
* implement the server-side part of a websocket connection rather than the
* client-side part.
*/
[must_use] void setServerParameters (in nsITransportProvider aProvider, in ACString aNegotiatedExtensions);
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 nsIWebSocketChannel
[src]
const IID: nsIID
IID: nsIID = nsID(3463565352, 12842, 16645, [169, 71, 168, 148, 104, 155, 82, 191])
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 nsIWebSocketChannel
[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 nsIWebSocketChannel
[src]
type Target = nsISupports
The resulting type after dereferencing.
fn deref(&self) -> &nsISupports
[src]
Dereferences the value.