[−][src]Struct actix_send_websocket::WsConfig
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
Auto Trait Implementations
impl RefUnwindSafe for WsConfig
impl Send for WsConfig
impl Sync for WsConfig
impl Unpin for WsConfig
impl UnwindSafe for WsConfig
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T> Instrument for T
[src]
fn instrument(self, span: Span) -> Instrumented<Self>
[src]
fn in_current_span(self) -> Instrumented<Self>
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> Same<T> for T
type Output = T
Should always be Self
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
fn to_owned(&self) -> T
[src]
fn clone_into(&self, target: &mut T)
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
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>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
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>
[src]
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
V: MultiLane<T>,