Struct twist::server::WebSocketProtocol
[−]
[src]
pub struct WebSocketProtocol { /* fields omitted */ }
The protocol that can bu use to run on a tokio-proto
TcpServer
to
handle websocket handshake and base frames.
Methods
impl WebSocketProtocol
[src]
fn client(&mut self, client: bool) -> &mut WebSocketProtocol
Set the client
flag.
fn stdout(&mut self, logger: Logger) -> &mut WebSocketProtocol
Add a stdout slog Logger
to this protocol.
fn stderr(&mut self, logger: Logger) -> &mut WebSocketProtocol
Add a stderr slog Logger
to this protocol.
fn per_message<T>(&mut self, extension: T) -> &mut WebSocketProtocol where
T: PerMessage + 'static,
T: PerMessage + 'static,
Register a per-message extension.
fn per_frame<T>(&mut self, extension: T) -> &mut WebSocketProtocol where
T: PerFrame + 'static,
T: PerFrame + 'static,
Register a per-frame extension.
Trait Implementations
impl<T: AsyncRead + AsyncWrite + 'static> ClientProto<T> for WebSocketProtocol
[src]
type Request = WebSocket
Request messages.
type Response = WebSocket
Response messages.
type Transport = ClientHandshake<Framed<T, Twist>>
The message transport, which works with I/O objects of type T
. Read more
type BindTransport = Result<Self::Transport, Error>
A future for initializing a transport from an I/O object. Read more
fn bind_transport(&self, io: T) -> Self::BindTransport
Build a transport from the given I/O object, using self
for any configuration. Read more
impl<T: AsyncRead + AsyncWrite + 'static> ServerProto<T> for WebSocketProtocol
[src]
type Request = WebSocket
Request messages.
type Response = WebSocket
Response messages.
type Transport = Handshake<Close<PingPong<Fragmented<Framed<T, Twist>>>>>
The message transport, which works with I/O objects of type T
. Read more
type BindTransport = Result<Self::Transport, Error>
A future for initializing a transport from an I/O object. Read more
fn bind_transport(&self, io: T) -> Self::BindTransport
Build a transport from the given I/O object, using self
for any configuration. Read more
impl Default for WebSocketProtocol
[src]
fn default() -> WebSocketProtocol
Returns the "default value" for a type. Read more