pub struct CableConnection { /* private fields */ }Expand description
The identity of one WebSocket connection.
Implementations§
Source§impl CableConnection
impl CableConnection
pub fn new() -> Self
Sourcepub fn identify(&mut self, key: &str, value: &str) -> &mut Self
pub fn identify(&mut self, key: &str, value: &str) -> &mut Self
Attach an identifier (Rails self.current_user = ...).
Sourcepub fn identifier(&self, key: &str) -> Option<&str>
pub fn identifier(&self, key: &str) -> Option<&str>
Read an identifier.
Mark the connection authorized (accept it).
Sourcepub fn reject(&mut self) -> &mut Self
pub fn reject(&mut self) -> &mut Self
Reject the connection (Rails reject_unauthorized_connection).
Whether the connection has been authorized.
Trait Implementations§
Source§impl Clone for CableConnection
impl Clone for CableConnection
Source§fn clone(&self) -> CableConnection
fn clone(&self) -> CableConnection
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 CableConnection
impl Debug for CableConnection
Source§impl Default for CableConnection
impl Default for CableConnection
Source§fn default() -> CableConnection
fn default() -> CableConnection
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for CableConnection
impl RefUnwindSafe for CableConnection
impl Send for CableConnection
impl Sync for CableConnection
impl Unpin for CableConnection
impl UnsafeUnpin for CableConnection
impl UnwindSafe for CableConnection
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