Trait StructMeta

Source
pub trait StructMeta:
    Copy
    + Clone
    + Debug {
    type Struct<'a>: Copy + Clone + Debug;

    const FIELDS: StructFields;
    const FIELD_COUNT: usize = _;
    const IS_FIXED_SIZE: bool = _;
    const FIXED_SIZE: Option<usize> = _;
    const LENGTH_FIELD_INDEX: Option<usize> = _;
    const HAS_LENGTH_FIELD: bool = _;

    // Required methods
    fn new<'a>(buf: &'a [u8]) -> Result<Self::Struct<'a>, ParseError>;
    fn to_vec(&self) -> Vec<u8> ;
}
Expand description

A trait for structs that describes their fields, containing some associated constants. Note that only FIELDS is provided. The remainder of the associated constants are computed from FIELDS.

Required Associated Constants§

Provided Associated Constants§

Required Associated Types§

Required Methods§

Source

fn new<'a>(buf: &'a [u8]) -> Result<Self::Struct<'a>, ParseError>

Source

fn to_vec(&self) -> 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§