Trait ProtocolExtensionBuilder

Source
pub trait ProtocolExtensionBuilder {
    // Required methods
    fn get_id(&self) -> u8;
    fn build_from_bytes(
        &self,
        bytes: Bytes,
        role: Role,
    ) -> Result<AnyProtocolExtension, WispError>;
    fn build_to_extension(&self, role: Role) -> AnyProtocolExtension;
}
Expand description

Trait to build a Wisp protocol extension from a payload.

Required Methods§

Source

fn get_id(&self) -> u8

Get the protocol extension ID.

Used to decide whether this builder should be used.

Source

fn build_from_bytes( &self, bytes: Bytes, role: Role, ) -> Result<AnyProtocolExtension, WispError>

Build a protocol extension from the extension’s metadata.

Source

fn build_to_extension(&self, role: Role) -> AnyProtocolExtension

Build a protocol extension to send to the other side.

Implementors§