pub fn read_next_at_most<R: Read, T: StacksMessageCodec + Sized>( fd: &mut R, max_items: u32) -> Result<Vec<T>, Error>