Struct wampire::client::ConnectionHandler
source · [−]pub struct ConnectionHandler { /* private fields */ }
Expand description
Represents connection handler
Trait Implementations
sourceimpl Debug for ConnectionHandler
impl Debug for ConnectionHandler
sourceimpl Handler for ConnectionHandler
impl Handler for ConnectionHandler
sourcefn on_open(&mut self, handshake: Handshake) -> WSResult<()>
fn on_open(&mut self, handshake: Handshake) -> WSResult<()>
Called when the WebSocket handshake is successful and the connection is open for sending and receiving messages. Read more
sourcefn on_message(&mut self, message: WSMessage) -> WSResult<()>
fn on_message(&mut self, message: WSMessage) -> WSResult<()>
Called on incoming messages.
sourcefn on_close(&mut self, _code: CloseCode, _reason: &str)
fn on_close(&mut self, _code: CloseCode, _reason: &str)
Called any time this endpoint receives a close control frame. This may be because the other endpoint is initiating a closing handshake, or it may be the other endpoint confirming the handshake initiated by this endpoint. Read more
sourcefn on_timeout(&mut self, token: Token) -> WSResult<()>
fn on_timeout(&mut self, token: Token) -> WSResult<()>
Called when a timeout is triggered. Read more
sourcefn build_request(&mut self, url: &Url) -> WSResult<Request>
fn build_request(&mut self, url: &Url) -> WSResult<Request>
A method for creating the initial handshake request for WebSocket clients. Read more
sourcefn on_shutdown(&mut self)
fn on_shutdown(&mut self)
Called when a request to shutdown all connections has been received.
sourcefn on_request(&mut self, req: &Request) -> Result<Response, Error>
fn on_request(&mut self, req: &Request) -> Result<Response, Error>
A method for handling the low-level workings of the request portion of the WebSocket handshake. Read more
sourcefn on_response(&mut self, res: &Response) -> Result<(), Error>
fn on_response(&mut self, res: &Response) -> Result<(), Error>
A method for handling the low-level workings of the response portion of the WebSocket handshake. Read more
sourcefn on_new_timeout(&mut self, Token, Timeout) -> Result<(), Error>
fn on_new_timeout(&mut self, Token, Timeout) -> Result<(), Error>
Called when a timeout has been scheduled on the eventloop. Read more
Auto Trait Implementations
impl !RefUnwindSafe for ConnectionHandler
impl Send for ConnectionHandler
impl !Sync for ConnectionHandler
impl Unpin for ConnectionHandler
impl !UnwindSafe for ConnectionHandler
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more