Struct twist_lz4::ServerLz4
[−]
[src]
pub struct ServerLz4 { /* fields omitted */ }
The lz4 server-side extension configuration.
Methods
impl Lz4
[src]
fn stdout(&mut self, logger: Logger) -> &mut Lz4
Add a stdout slog Logger
to this protocol.
fn stderr(&mut self, logger: Logger) -> &mut Lz4
Add a stderr slog Logger
to this protocol.
Trait Implementations
impl Default for Lz4
[src]
impl Header for Lz4
[src]
fn from_header(&mut self, header: &str) -> Result<(), Error>
Initialize your extension from the given Sec-WebSocket-Extensions
header string. If your extension parameters exist, but are invalid, you should return an error here. If they don't exist you should mark yourself disabled (see enabled below), and return Ok. For a server-side extension, this will be called first, and should be used to generate the value that will be returned by into_header
. For a client-side extension, this will be called after the server response is received, and should be use to re-configure your extension based on the value. Read more
fn into_header(&mut self) -> Result<Option<String>>
This should return your extensions Sec-WebSocket-Extensions
header to be used in a request or response. For a server-side extension, this will be called after from_header
has been called and the extension is configures. This result should represent your negotiation response. For a client-side extension, this will be called to ge the header for an extension negotiation request. Read more
impl PerMessage for Lz4
[src]
fn enabled(&self) -> bool
Is this extension enabled? This should return true if you are able to support the given Sec-WebSocket-Extensions
header parameters. It should return false otherwise. Read more
fn reserve_rsv(&self, reserved: u8) -> Result<u8, Error>
Reserve rsvX
bits for use by your extension. Valid values are 0 - 8 (no rsv bits reserved, up to all 3). If your bits are already reserved by an extension earlier in the chain, return an io::Error. Read more
fn decode(&self, frame: &mut BaseFrame) -> Result<(), Error>
Transform the given application data/extension data bytes as necessary.
fn encode(&self, frame: &mut BaseFrame) -> Result<(), Error>
Transform the given bytes into application/extension data bytes as necessary.