Struct stdweb::web::WebSocket [] [src]

pub struct WebSocket(_);

The WebSocket object provides the API for creating and managing a WebSocket connection to a server, as well as for sending and receiving data on the connection.

(JavaScript docs)

Methods

impl WebSocket
[src]

[src]

Returns a newly constructed WebSocket.

(JavaScript docs)

[src]

Returns a newly constructed WebSocket.

(JavaScript docs)

[src]

Returns the binary type of the web socket. Only affects received messages. The default binary type is Blob.

(JavaScript docs)

[src]

Sets the binary type of the web socket. Only affects received messages. The default binary type is Blob.

(JavaScript docs)

[src]

Returns the number of bytes of data that have been queued using calls to send() but not yet transmitted to the network. This value resets to zero once all queued data has been sent. This value does not reset to zero when the connection is closed; if you keep calling send(), this will continue to climb.

(JavaScript docs)

[src]

Returns the extensions selected by the server. This is currently only the empty string or a list of extensions as negotiated by the connection.

(JavaScript docs)

[src]

Returns a string indicating the name of the sub-protocol the server selected; this will be one of the strings specified in the protocols parameter when creating the WebSocket object.

(JavaScript docs)

[src]

Returns the current state of the connection.

(JavaScript docs)

[src]

Returns the URL as resolved by the constructor. This is always an absolute URL.

(JavaScript docs)

[src]

Closes the WebSocket connection or connection attempt, if any. If the connection is already CLOSED, this method does nothing.

(JavaScript docs)

[src]

Closes the WebSocket connection or connection attempt, if any. If the connection is already CLOSED, this method does nothing.

(JavaScript docs)

[src]

Enqueues the specified data to be transmitted to the server over the WebSocket connection, increasing the value of bufferedAmount by the number of bytes needed to contain the data. If the data can't be sent (for example, because it needs to be buffered but the buffer is full), the socket is closed automatically.

[src]

Enqueues the specified data to be transmitted to the server over the WebSocket connection, increasing the value of bufferedAmount by the number of bytes needed to contain the data. If the data can't be sent (for example, because it needs to be buffered but the buffer is full), the socket is closed automatically.

[src]

Enqueues the specified data to be transmitted to the server over the WebSocket connection, increasing the value of bufferedAmount by the number of bytes needed to contain the data. If the data can't be sent (for example, because it needs to be buffered but the buffer is full), the socket is closed automatically.

[src]

Enqueues the specified data to be transmitted to the server over the WebSocket connection, increasing the value of bufferedAmount by the number of bytes needed to contain the data. If the data can't be sent (for example, because it needs to be buffered but the buffer is full), the socket is closed automatically.

Trait Implementations

impl Clone for WebSocket
[src]

[src]

Returns a copy of the value. Read more

1.0.0
[src]

Performs copy-assignment from source. Read more

impl Debug for WebSocket
[src]

[src]

Formats the value using the given formatter. Read more

impl PartialEq for WebSocket
[src]

[src]

This method tests for self and other values to be equal, and is used by ==. Read more

[src]

This method tests for !=.

impl Eq for WebSocket
[src]

impl From<WebSocket> for EventTarget
[src]

[src]

Performs the conversion.

impl TryFrom<EventTarget> for WebSocket
[src]

The type returned in the event of a conversion error.

[src]

Performs the conversion.

impl InstanceOf for WebSocket
[src]

[src]

Checks whenever a given Reference if of type Self.

impl AsRef<Reference> for WebSocket
[src]

[src]

Performs the conversion.

impl ReferenceType for WebSocket
[src]

[src]

Converts a given reference into a concrete reference-like wrapper. Doesn't do any type checking; highly unsafe to use! Read more

impl From<WebSocket> for Reference
[src]

[src]

Performs the conversion.

impl TryFrom<WebSocket> for Reference
[src]

The type returned in the event of a conversion error.

[src]

Performs the conversion.

impl TryFrom<Reference> for WebSocket
[src]

The type returned in the event of a conversion error.

[src]

Performs the conversion.

impl<'_r> TryFrom<&'_r Reference> for WebSocket
[src]

The type returned in the event of a conversion error.

[src]

Performs the conversion.

impl TryFrom<Value> for WebSocket
[src]

The type returned in the event of a conversion error.

[src]

Performs the conversion.

impl<'_r> TryFrom<&'_r Value> for WebSocket
[src]

The type returned in the event of a conversion error.

[src]

Performs the conversion.

impl JsSerialize for WebSocket
[src]

impl IEventTarget for WebSocket
[src]

[src]

Adds given event handler to the list of event listeners for the specified EventTarget on which it's called. Read more

[src]

Dispatches an Event at this EventTarget, invoking the affected event listeners in the appropriate order. Read more

Auto Trait Implementations

impl Send for WebSocket

impl Sync for WebSocket