[][src]Struct actix_send_websocket::WsConfig

pub struct WsConfig { /* fields omitted */ }

config for WebSockets.

example:

use actix_web::{App, HttpServer};
use actix_send_websocket::WsConfig;

#[actix_web::main]
async fn main() -> std::io::Result<()> {
    HttpServer::new(||
        App::new().app_data(WsConfig::new().disable_heartbeat())
    )
    .bind("127.0.0.1:8080")?
    .run()
    .await
}

Implementations

impl WsConfig[src]

pub fn new() -> Self[src]

pub fn codec(self, codec: Codec) -> Self[src]

Set WebSockets protocol codec.

pub fn protocols(self, protocols: Vec<String>) -> Self[src]

Set specific protocol strings. protocols is a sequence of known protocols. On successful handshake, the returned response headers contain the first protocol in this list which the server also knows.

pub fn heartbeat(self, dur: Duration) -> Self[src]

Set the heartbeat check interval.

pub fn timeout(self, dur: Duration) -> Self[src]

Set the timeout duration for client does not send Ping for too long.

pub fn disable_heartbeat(self) -> Self[src]

Disable heartbeat check.

pub fn enable_server_send_heartbeat(self) -> Self[src]

Enable the heartbeat from Server side to Client.

Trait Implementations

impl Clone for WsConfig[src]

impl Default for WsConfig[src]

Auto Trait Implementations

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> Instrument 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> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

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.

impl<V, T> VZip<V> for T where
    V: MultiLane<T>,