Struct websocket::header::WebSocketKey
source · [−]pub struct WebSocketKey(pub WebSocketKeyLL);
Expand description
Represents a Sec-WebSocket-Key header.
Tuple Fields
0: WebSocketKeyLL
Implementations
sourceimpl 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
sourceimpl Clone for WebSocketKey
impl Clone for WebSocketKey
sourcefn clone(&self) -> WebSocketKey
fn clone(&self) -> WebSocketKey
Returns a copy of the value. Read more
1.0.0 · sourcefn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source
. Read more
sourceimpl Debug for WebSocketKey
impl Debug for WebSocketKey
sourceimpl Default for WebSocketKey
impl Default for WebSocketKey
sourcefn default() -> WebSocketKey
fn default() -> WebSocketKey
Returns the “default value” for a type. Read more
sourceimpl FromStr for WebSocketKey
impl FromStr for WebSocketKey
type Err = WebSocketError
type Err = WebSocketError
The associated error which can be returned from parsing.
sourcefn 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 more
sourceimpl Header for WebSocketKey
impl Header for WebSocketKey
sourcefn header_name() -> &'static str
fn header_name() -> &'static str
Returns the name of the header field this belongs to. Read more
sourcefn 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
sourceimpl HeaderFormat for WebSocketKey
impl HeaderFormat for WebSocketKey
sourcefn fmt_header(&self, fmt: &mut Formatter<'_>) -> Result
fn fmt_header(&self, fmt: &mut Formatter<'_>) -> Result
Format a header to be output into a TcpStream. Read more
sourceimpl PartialEq<WebSocketKey> for WebSocketKey
impl PartialEq<WebSocketKey> for WebSocketKey
sourcefn 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 ==
. Read more
sourcefn ne(&self, other: &WebSocketKey) -> bool
fn ne(&self, other: &WebSocketKey) -> bool
This method tests for !=
.
impl Copy for WebSocketKey
impl StructuralPartialEq for WebSocketKey
Auto Trait Implementations
impl RefUnwindSafe for WebSocketKey
impl Send for WebSocketKey
impl Sync for WebSocketKey
impl Unpin for WebSocketKey
impl UnwindSafe for WebSocketKey
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