Struct embedded_websocket::framer::Framer[][src]

pub struct Framer<'a, TRng, TWebSocketType> where
    TRng: RngCore,
    TWebSocketType: WebSocketType
{ /* fields omitted */ }

Implementations

impl<'a, TRng> Framer<'a, TRng, Client> where
    TRng: RngCore
[src]

pub fn connect<E>(
    &mut self,
    stream: &mut impl Stream<E>,
    websocket_options: &WebSocketOptions<'_>
) -> Result<Option<WebSocketSubProtocol>, FramerError<E>>
[src]

impl<'a, TRng> Framer<'a, TRng, Server> where
    TRng: RngCore
[src]

pub fn accept<E>(
    &mut self,
    stream: &mut impl Stream<E>,
    websocket_context: &WebSocketContext
) -> Result<(), FramerError<E>>
[src]

impl<'a, TRng, TWebSocketType> Framer<'a, TRng, TWebSocketType> where
    TRng: RngCore,
    TWebSocketType: WebSocketType
[src]

pub fn new(
    read_buf: &'a mut [u8],
    read_cursor: &'a mut usize,
    write_buf: &'a mut [u8],
    websocket: &'a mut WebSocket<TRng, TWebSocketType>
) -> Self
[src]

pub fn state(&self) -> WebSocketState[src]

pub fn close<E>(
    &mut self,
    stream: &mut impl Stream<E>,
    close_status: WebSocketCloseStatusCode,
    status_description: Option<&str>
) -> Result<(), FramerError<E>>
[src]

pub fn write<E>(
    &mut self,
    stream: &mut impl Stream<E>,
    message_type: WebSocketSendMessageType,
    end_of_message: bool,
    frame_buf: &[u8]
) -> Result<(), FramerError<E>>
[src]

pub fn read_text<'b, E>(
    &mut self,
    stream: &mut impl Stream<E>,
    frame_buf: &'b mut [u8]
) -> Result<Option<&'b str>, FramerError<E>>
[src]

pub fn read_binary<'b, E>(
    &mut self,
    stream: &mut impl Stream<E>,
    frame_buf: &'b mut [u8]
) -> Result<Option<&'b [u8]>, FramerError<E>>
[src]

Auto Trait Implementations

impl<'a, TRng, TWebSocketType> RefUnwindSafe for Framer<'a, TRng, TWebSocketType> where
    TRng: RefUnwindSafe,
    TWebSocketType: RefUnwindSafe

impl<'a, TRng, TWebSocketType> Send for Framer<'a, TRng, TWebSocketType> where
    TRng: Send,
    TWebSocketType: Send

impl<'a, TRng, TWebSocketType> Sync for Framer<'a, TRng, TWebSocketType> where
    TRng: Sync,
    TWebSocketType: Sync

impl<'a, TRng, TWebSocketType> Unpin for Framer<'a, TRng, TWebSocketType>

impl<'a, TRng, TWebSocketType> !UnwindSafe for Framer<'a, TRng, TWebSocketType>

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> Same<T> for T

type Output = T

Should always be Self

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.