tab_websocket/message/listener.rs
1use crate::bus::WebsocketConnectionBus;
2use tungstenite::http::{Method, Uri};
3
4/// A connection event on a websocket server listener.
5/// Provides a bus, which can be carried into your bus (which must implement WebsocketConnectionBus),
6/// as well as metadata about the request.
7///
8/// If the listener specified an auth token, this request has been authenticated.
9#[derive(Debug)]
10pub struct WebsocketConnectionMessage {
11 pub bus: WebsocketConnectionBus,
12 pub request: RequestMetadata,
13}
14
15/// Metadata about the HTTP request which initialized the connection.
16#[derive(Debug, Clone)]
17pub struct RequestMetadata {
18 pub method: Method,
19 pub uri: Uri,
20}