pub struct WebSocketPlugin { /* private fields */ }Expand description
Process-wide WebSocketPlugin singleton holding a shared WebSocket room hub.
Implementations§
Source§impl WebSocketPlugin
Inherent implementation of WebSocketPlugin.
impl WebSocketPlugin
Inherent implementation of WebSocketPlugin.
Sourcepub fn init(websocket: WebSocket) -> &'static Self
pub fn init(websocket: WebSocket) -> &'static Self
Initializes the global WebSocketPlugin once with websocket.
§Arguments
WebSocket- Shared WebSocket broadcast hub.
§Returns
&'static Self- Reference to the initialized global plugin.
Sourcepub fn init_default() -> &'static Self
pub fn init_default() -> &'static Self
Initializes the global WebSocketPlugin once with a default WebSocket hub.
§Returns
&'static Self- Reference to the initialized global plugin.
Sourcepub fn get() -> Option<&'static Self>
pub fn get() -> Option<&'static Self>
Returns the initialized global WebSocketPlugin, if initialized.
§Returns
Option<&'static Self>- Reference to the global plugin, orNone.
Sourcepub fn get_websocket(&self) -> &WebSocket
pub fn get_websocket(&self) -> &WebSocket
Trait Implementations§
Source§impl Clone for WebSocketPlugin
impl Clone for WebSocketPlugin
Source§impl Debug for WebSocketPlugin
impl Debug for WebSocketPlugin
Auto Trait Implementations§
impl !RefUnwindSafe for WebSocketPlugin
impl !UnwindSafe for WebSocketPlugin
impl Forget for WebSocketPlugin
impl Freeze for WebSocketPlugin
impl Move for WebSocketPlugin
impl Send for WebSocketPlugin
impl Sync for WebSocketPlugin
impl Unpin for WebSocketPlugin
impl UnsafeUnpin for WebSocketPlugin
Blanket Implementations§
impl<T> AnySend for T
impl<T> AnySendClone for T
impl<T> AnySendSync for T
impl<T> AnySendSyncClone for T
impl<T> AnySync for T
impl<T> AnySyncClone for T
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