pub struct WebSocketContext {
pub request: BootRequest,
pub gateway_path: String,
pub event: String,
pub namespace: Option<String>,
pub module_name: Option<String>,
/* private fields */
}Expand description
Context available to WebSocket guards and interceptors.
Fields§
§request: BootRequest§gateway_path: String§event: String§namespace: Option<String>§module_name: Option<String>Implementations§
Source§impl WebSocketContext
impl WebSocketContext
pub fn server(&self) -> WebSocketGatewayServer
pub fn execution_context(&self) -> &ExecutionContext
pub fn into_execution_context(self) -> ExecutionContext
Methods from Deref<Target = ExecutionContext>§
pub fn protocol(&self) -> ExecutionProtocol
pub fn websocket_context(&self) -> Option<&WebSocketExecutionContext>
pub fn transport_context(&self) -> Option<&TransportExecutionContext>
pub fn metadata_value(&self, key: &str) -> Option<&Value>
pub fn metadata_as<T>(&self, key: &str) -> Result<Option<T>>where
T: DeserializeOwned,
Trait Implementations§
Source§impl Clone for WebSocketContext
impl Clone for WebSocketContext
Source§fn clone(&self) -> WebSocketContext
fn clone(&self) -> WebSocketContext
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for WebSocketContext
impl Debug for WebSocketContext
Auto Trait Implementations§
impl !RefUnwindSafe for WebSocketContext
impl !UnwindSafe for WebSocketContext
impl Freeze for WebSocketContext
impl Send for WebSocketContext
impl Sync for WebSocketContext
impl Unpin for WebSocketContext
impl UnsafeUnpin for WebSocketContext
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more