Trait soup::prelude::WebsocketExtensionExt
source · pub trait WebsocketExtensionExt: IsA<WebsocketExtension> + Sealed + 'static {
// Provided methods
fn request_params(&self) -> Option<GString> { ... }
fn response_params(&self) -> Option<GString> { ... }
fn process_incoming_message(
&self,
header: &mut u8,
payload: Bytes
) -> Result<Bytes, Error> { ... }
fn process_outgoing_message(
&self,
header: &mut u8,
payload: Bytes
) -> Result<Bytes, Error> { ... }
}
Expand description
Trait containing all WebsocketExtension
methods.
§Implementors
Provided Methods§
sourcefn request_params(&self) -> Option<GString>
fn request_params(&self) -> Option<GString>
sourcefn response_params(&self) -> Option<GString>
fn response_params(&self) -> Option<GString>
sourcefn process_incoming_message(
&self,
header: &mut u8,
payload: Bytes
) -> Result<Bytes, Error>
fn process_incoming_message( &self, header: &mut u8, payload: Bytes ) -> Result<Bytes, Error>
Process a message after it’s received.
If the payload isn’t changed the given @payload is just returned, otherwise
GLib::Bytes::unref()
is called on the given @payload and a new
glib::Bytes
is returned with the new data.
Extensions using reserved bits of the header will reset them in @header.
§header
the message header
§payload
the payload data
§Returns
the message payload data, or None
in case of error
sourcefn process_outgoing_message(
&self,
header: &mut u8,
payload: Bytes
) -> Result<Bytes, Error>
fn process_outgoing_message( &self, header: &mut u8, payload: Bytes ) -> Result<Bytes, Error>
Process a message before it’s sent.
If the payload isn’t changed the given @payload is just returned, otherwise
Glib::Bytes::unref()
is called on the given @payload and a new
glib::Bytes
is returned with the new data.
Extensions using reserved bits of the header will change them in @header.
§header
the message header
§payload
the payload data
§Returns
the message payload data, or None
in case of error