pub enum Context {
Server,
Client,
}
Expand description
Even though a websocket connection may look perfectly symmetrical in reality there are small differences between clients and servers. This type is passed to the codecs to inform them of what role they are in (i.e. that of a Client or Server).
For those familiar with the protocol, this decides whether the data should be masked or not.
Variants
Server
Set the codec to act in Server
mode, used when
implementing a websocket server.
Client
Set the codec to act in Client
mode, used when
implementing a websocket client.
Trait Implementations
impl Copy for Context
impl Eq for Context
impl StructuralEq for Context
impl StructuralPartialEq for Context
Auto Trait Implementations
impl RefUnwindSafe for Context
impl Send for Context
impl Sync for Context
impl Unpin for Context
impl UnwindSafe for Context
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