pub fn read_all<T>(bytes: &[u8], f: impl Fn(&[u8], &mut usize) -> ReadResult<T>) -> ReadResult<Vec<T>> {
    profile!(T, "read_all");
    let mut offset = 0;
    let mut result = Vec::new();
    while offset < bytes.len() {
        let read = f(bytes, &mut offset)?;
        result.push(read);
    }
    debug_assert_eq!(offset, bytes.len());

    Ok(result)
}
/// Reads all items from some byte aligned encoding
Reads all items from some byte aligned encoding
Reads all items from some byte aligned encoding
pub fn read_all<T>(bytes: &[u8], f: impl Fn(&[u8], &mut usize) -> ReadResult<T>) -> ReadResult<Vec<T>> {
    profile!(T, "read_all");
    let mut offset = 0;
    let mut result = Vec::new();
    while offset < bytes.len() {
        let read = f(bytes, &mut offset)?;
        result.push(read);
    }
    debug_assert_eq!(offset, bytes.len());
    Ok(result)
}
pub fn read_all < T > ( bytes : & [ u8 ] , f : impl Fn ( & [ u8 ] , & mut usize ) -> ReadResult < T > ) -> ReadResult < Vec < T > > { profile ! ( T " " ) ; let mut offset = 0 ; let mut result = Vec :: new ( ) ; while offset < bytes . len ( ) { let read = f ( bytes , & mut offset ) ? ; result . push ( read ) ; } debug_assert_eq ! ( offset bytes len ( ) ) ; Ok ( result ) }
Reads all items from some byte aligned encoding
Reads all items from some byte aligned encoding
bytes
&[u8]
f
impl Fn(&[u8], &mut usize) -> ReadResult<T>
bytes
&[u8]
f
impl Fn(&[u8], &mut usize) -> ReadResult<T>