pub struct WsFrame {
pub fin: bool,
pub opcode: OpCode,
pub mask: Option<[u8; 4]>,
pub payload: Vec<u8>,
}Fields§
§fin: bool§opcode: OpCode§mask: Option<[u8; 4]>§payload: Vec<u8>Implementations§
Source§impl WsFrame
impl WsFrame
pub fn new_text(payload: Vec<u8>) -> Self
pub fn new_binary(payload: Vec<u8>) -> Self
pub fn new_close(code: u16, reason: &str) -> Self
pub fn new_pong(payload: Vec<u8>) -> Self
pub fn encode(&self) -> Vec<u8> ⓘ
pub fn parse_all(data: &[u8]) -> Result<Vec<WsFrame>, String>
Trait Implementations§
Auto Trait Implementations§
impl Freeze for WsFrame
impl RefUnwindSafe for WsFrame
impl Send for WsFrame
impl Sync for WsFrame
impl Unpin for WsFrame
impl UnsafeUnpin for WsFrame
impl UnwindSafe for WsFrame
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