pub struct Sender { /* fields omitted */ }
A representation of the output of the WebSocket connection. Use this to send messages to the
other endpoint.
A Token identifying this sender within the WebSocket.
A connection_id identifying this sender within the WebSocket.
Send a message over the connection.
Send a message to the endpoints of all connections.
Be careful with this method. It does not discriminate between client and server connections.
If your WebSocket is only functioning as a server, then usage is simple, this method will
send a copy of the message to each connected client. However, if you have a WebSocket that
is listening for connections and is also connected to another WebSocket, this method will
broadcast a copy of the message to all the clients connected and to that WebSocket server.
Send a close code to the other endpoint.
Send a close code and provide a descriptive reason for closing.
Send a ping to the other endpoint with the given test data.
Send a pong to the other endpoint responding with the given test data.
Queue a new connection on this WebSocket to the specified URL.
Request that all connections terminate and that the WebSocket stop running.
Schedule a token
to be sent to the WebSocket Handler's on_timeout
method
after ms
milliseconds
Queue the cancellation of a previously scheduled timeout.
This method is not guaranteed to prevent the timeout from occurring, because it is
possible to call this method after a timeout has already occurred. It is still necessary to
handle spurious timeouts.
Performs copy-assignment from source
. Read more
This method tests for self
and other
values to be equal, and is used by ==
. Read more
This method tests for !=
.
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
🔬 This is a nightly-only experimental API. (get_type_id
)
this method will likely be replaced by an associated static
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
)