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)
Returns the binary type of the web socket. Only affects received messages.
The default binary type is Blob
.
(JavaScript docs)
Sets the binary type of the web socket. Only affects received messages.
The default binary type is Blob
.
(JavaScript docs)
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)
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)
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)
Returns the URL as resolved by the constructor. This is always an absolute URL.
(JavaScript docs)
Closes the WebSocket connection or connection attempt, if any. If the connection
is already CLOSED, this method does nothing.
(JavaScript docs)
Closes the WebSocket connection or connection attempt, if any. If the connection
is already CLOSED, this method does nothing.
(JavaScript docs)
pub fn send_text(&self, text: &str) -> Result<(), TODO> | [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.
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.
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.
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.
type Error = ConversionError
The type returned in the event of a conversion error.
The type returned in the event of a conversion error.
type Error = ConversionError
The type returned in the event of a conversion error.
type Error = ConversionError
The type returned in the event of a conversion error.
type Error = ConversionError
The type returned in the event of a conversion error.
type Error = ConversionError
The type returned in the event of a conversion error.
Checks whenever a given Reference if of type Self
.
Converts a given reference into a concrete reference-like wrapper. Doesn't do any type checking; highly unsafe to use! Read more
Adds given event handler to the list of event listeners for the specified EventTarget
on which it's called. Read more
Dispatches an Event
at this EventTarget
, invoking the affected event listeners in the appropriate order. Read more
This method tests for self
and other
values to be equal, and is used by ==
. Read more
This method tests for !=
.
Performs copy-assignment from source
. Read more
Formats the value using the given formatter. Read more
Creates owned data from borrowed data, usually by cloning. Read more
🔬 This is a nightly-only experimental API. (toowned_clone_into
)
recently added
Uses borrowed data to replace owned data, usually by cloning. Read more
🔬 This is a nightly-only experimental API. (try_from
)
The type returned in the event of a conversion error.
🔬 This is a nightly-only experimental API. (try_from
)
Immutably borrows from an owned value. Read more
Mutably borrows from an owned value. Read more
🔬 This is a nightly-only experimental API. (try_from
)
The type returned in the event of a conversion error.
🔬 This is a nightly-only experimental API. (try_from
)
🔬 This is a nightly-only experimental API. (get_type_id
)
this method will likely be replaced by an associated static