Struct websocket::header::WebSocketKey
source · pub struct WebSocketKey(pub WebSocketKey);
Expand description
Represents a Sec-WebSocket-Key header.
Tuple Fields§
§0: WebSocketKey
Implementations§
source§impl WebSocketKey
impl WebSocketKey
sourcepub fn new() -> WebSocketKey
pub fn new() -> WebSocketKey
Generate a new, random WebSocketKey
sourcepub fn from_array(a: [u8; 16]) -> WebSocketKey
pub fn from_array(a: [u8; 16]) -> WebSocketKey
Create WebSocketKey by explicitly specifying the key
Trait Implementations§
source§impl Clone for WebSocketKey
impl Clone for WebSocketKey
source§fn clone(&self) -> WebSocketKey
fn clone(&self) -> WebSocketKey
Returns a copy of the value. Read more
1.0.0 · 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 WebSocketKey
impl Debug for WebSocketKey
source§impl Default for WebSocketKey
impl Default for WebSocketKey
source§fn default() -> WebSocketKey
fn default() -> WebSocketKey
Returns the “default value” for a type. Read more
source§impl FromStr for WebSocketKey
impl FromStr for WebSocketKey
§type Err = WebSocketError
type Err = WebSocketError
The associated error which can be returned from parsing.
source§fn from_str(key: &str) -> WebSocketResult<WebSocketKey>
fn from_str(key: &str) -> WebSocketResult<WebSocketKey>
Parses a string
s
to return a value of this type. Read moresource§impl Header for WebSocketKey
impl Header for WebSocketKey
source§fn header_name() -> &'static str
fn header_name() -> &'static str
Returns the name of the header field this belongs to. Read more
source§fn parse_header(raw: &[Vec<u8>]) -> Result<WebSocketKey>
fn parse_header(raw: &[Vec<u8>]) -> Result<WebSocketKey>
Parse a header from a raw stream of bytes. Read more
source§impl HeaderFormat for WebSocketKey
impl HeaderFormat for WebSocketKey
source§impl PartialEq for WebSocketKey
impl PartialEq for WebSocketKey
source§fn eq(&self, other: &WebSocketKey) -> bool
fn eq(&self, other: &WebSocketKey) -> bool
This method tests for
self
and other
values to be equal, and is used
by ==
.impl Copy for WebSocketKey
impl StructuralPartialEq for WebSocketKey
Auto Trait Implementations§
impl Freeze for WebSocketKey
impl RefUnwindSafe for WebSocketKey
impl Send for WebSocketKey
impl Sync for WebSocketKey
impl Unpin for WebSocketKey
impl UnwindSafe for WebSocketKey
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