DirectChannel

Trait DirectChannel 

Source
pub trait DirectChannel {
    const CHANNEL_ID: &'static str;
    const CDDL_SCHEMA: &'static str;
    const ELEMENTS: u64;
    const PAYLOAD_SIZE: usize;

    // Required method
    fn encode_cbor(
        &self,
        api: &dyn Api,
        encoder: &mut Encoder<&mut [u8]>,
    ) -> StdResult<()>;

    // Provided methods
    fn channel_id(&self) -> String { ... }
    fn cddl_schema(&self) -> String { ... }
    fn to_cbor(&self, api: &dyn Api) -> StdResult<Vec<u8>> { ... }
}

Required Associated Constants§

Required Methods§

Source

fn encode_cbor( &self, api: &dyn Api, encoder: &mut Encoder<&mut [u8]>, ) -> StdResult<()>

CBOR encodes notification data into the encoder

Provided Methods§

Source

fn channel_id(&self) -> String

Source

fn cddl_schema(&self) -> String

Source

fn to_cbor(&self, api: &dyn Api) -> StdResult<Vec<u8>>

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§