1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
use bytes::Bytes; pub trait Codec { const ID: &'static str; type Data; } pub struct H264; impl Codec for H264 { const ID: &'static str = "h264"; type Data = Bytes; }