pub trait CodecList: Sized {
type D: ?Sized;
fn new() -> Self;
fn by_name(&self, name: &str) -> Option<&'static Self::D>;
fn append(&mut self, desc: &'static Self::D);
fn from_list(descs: &[&'static Self::D]) -> Self {
let mut c = Self::new();
for &desc in descs {
c.append(desc);
}
c
}
}