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§
const CHANNEL_ID: &'static str
const CDDL_SCHEMA: &'static str
const ELEMENTS: u64
const PAYLOAD_SIZE: usize
Required Methods§
Provided Methods§
fn channel_id(&self) -> String
fn cddl_schema(&self) -> String
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.