Skip to main content

Ext

Trait Ext 

Source
pub(super) trait Ext: Sized {
    type Id: From<u8> + Into<u8>;

    // Required methods
    fn type_id(&self) -> Self::Id;
    fn take_body_from(b: &mut Reader<'_>) -> Result<Self>;
    fn write_body_onto<B: Writer + ?Sized>(&self, b: &mut B) -> EncodeResult<()>;
}
Expand description

A single typed extension that can be used with some kind of relay message.

Required Associated Types§

Source

type Id: From<u8> + Into<u8>

An identifier kind used with this sort of extension.

Typically defined with caret_int.

Required Methods§

Source

fn type_id(&self) -> Self::Id

The field-type id for this particular extension.

Source

fn take_body_from(b: &mut Reader<'_>) -> Result<Self>

Extract the body (not the type or the length) from a single extension.

Source

fn write_body_onto<B: Writer + ?Sized>(&self, b: &mut B) -> EncodeResult<()>

Write the body (not the type or the length) for a single extension.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§