Enum esp_idf_svc::http::server::ws::EspHttpWsConnection

source ·
pub enum EspHttpWsConnection {
    New(httpd_handle_t, *mut httpd_req_t),
    Receiving(httpd_handle_t, *mut httpd_req_t, Option<httpd_ws_frame_t>),
    Closed(c_int),
}
Expand description

A Websocket connection between this server and a client.

Variants§

§

New(httpd_handle_t, *mut httpd_req_t)

§

Receiving(httpd_handle_t, *mut httpd_req_t, Option<httpd_ws_frame_t>)

§

Closed(c_int)

Implementations§

source§

impl EspHttpWsConnection

source

pub fn session(&self) -> i32

source

pub fn is_new(&self) -> bool

Returns true when the connection still hasn’t received any data

source

pub fn is_closed(&self) -> bool

Returns true when the connection already has been closed.

source

pub fn create_detached_sender( &self, ) -> Result<EspHttpWsDetachedSender, EspError>

source

pub fn send( &mut self, frame_type: FrameType, frame_data: &[u8], ) -> Result<(), EspError>

Sends a frame to the client.

source

pub fn recv( &mut self, frame_data_buf: &mut [u8], ) -> Result<(FrameType, usize), EspError>

Receives a frame from the client.

Trait Implementations§

source§

impl ErrorType for EspHttpWsConnection

source§

impl Receiver for EspHttpWsConnection

source§

fn recv( &mut self, frame_data_buf: &mut [u8], ) -> Result<(FrameType, usize), Self::Error>

source§

impl Sender for EspHttpWsConnection

source§

fn send( &mut self, frame_type: FrameType, frame_data: &[u8], ) -> Result<(), Self::Error>

Auto Trait Implementations§

§

impl Freeze for EspHttpWsConnection

§

impl RefUnwindSafe for EspHttpWsConnection

§

impl !Send for EspHttpWsConnection

§

impl !Sync for EspHttpWsConnection

§

impl Unpin for EspHttpWsConnection

§

impl UnwindSafe for EspHttpWsConnection

Blanket Implementations§

§

impl<T> Any for T
where T: 'static + ?Sized,

§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<T> Borrow<T> for T
where T: ?Sized,

§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
§

impl<T> BorrowMut<T> for T
where T: ?Sized,

§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
§

impl<T> From<T> for T

§

fn from(t: T) -> T

Returns the argument unchanged.

§

impl<T, U> Into<U> for T
where U: From<T>,

§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of [From]<T> for U chooses to do.

§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

§

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

The type returned in the event of a conversion error.
§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.