Struct actix_http::ws::Parser
source · [−]pub struct Parser;
Expand description
A struct representing a WebSocket frame.
Implementations
sourceimpl Parser
impl Parser
sourcepub fn parse(
src: &mut BytesMut,
server: bool,
max_size: usize
) -> Result<Option<(bool, OpCode, Option<BytesMut>)>, ProtocolError>
pub fn parse(
src: &mut BytesMut,
server: bool,
max_size: usize
) -> Result<Option<(bool, OpCode, Option<BytesMut>)>, ProtocolError>
Parse the input stream into a frame.
sourcepub fn parse_close_payload(payload: &[u8]) -> Option<CloseReason>
pub fn parse_close_payload(payload: &[u8]) -> Option<CloseReason>
Parse the payload of a close frame.
sourcepub fn write_message<B: AsRef<[u8]>>(
dst: &mut BytesMut,
pl: B,
op: OpCode,
fin: bool,
mask: bool
)
pub fn write_message<B: AsRef<[u8]>>(
dst: &mut BytesMut,
pl: B,
op: OpCode,
fin: bool,
mask: bool
)
Generate binary representation
sourcepub fn write_close(dst: &mut BytesMut, reason: Option<CloseReason>, mask: bool)
pub fn write_close(dst: &mut BytesMut, reason: Option<CloseReason>, mask: bool)
Create a new Close control frame.
Trait Implementations
Auto Trait Implementations
impl RefUnwindSafe for Parser
impl Send for Parser
impl Sync for Parser
impl Unpin for Parser
impl UnwindSafe for Parser
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
sourceimpl<T> Instrument for T
impl<T> Instrument for T
sourcefn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
sourcefn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
sourceimpl<T> WithSubscriber for T
impl<T> WithSubscriber for T
sourcefn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> where
S: Into<Dispatch>,
fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> where
S: Into<Dispatch>,
Attaches the provided Subscriber
to this type, returning a
WithDispatch
wrapper. Read more
sourcefn with_current_subscriber(self) -> WithDispatch<Self>
fn with_current_subscriber(self) -> WithDispatch<Self>
Attaches the current default Subscriber
to this type, returning a
WithDispatch
wrapper. Read more