/// Reads extent data from a leaf node.
///
/// # Arguments
/// * `extent`: Extent from which to read data from.
/// * `data`: Vec where data that is read is added.
/// * `allowance`: The maximum number of bytes to read from the extent. The
///    given file allowance is updated on each call to track sizing for an
///    entire extent tree.
Reads extent data from a leaf node.
Reads extent data from a leaf node .
fn read_extent_data(
        &self,
        extent: &Extent,
        data: &mut Vec<u8>,
        allowance: &mut u64,
    ) -> Result<(), ParsingError> {
        let mut extent_data = self.extent_data(&extent, *allowance)?;
        let extent_len = extent_data.len() as u64;
        if extent_len > *allowance {
            return Err(ParsingError::ExtentUnexpectedLength(extent_len, *allowance));
        }
        *allowance -= extent_len;
        data.append(&mut extent_data);
        Ok(())
    }
fn read_extent_data ( & self , extent : & Extent , data : & mut Vec < u8 > , allowance : & mut u64 , ) -> Result < ( ) , ParsingError > { let mut extent_data = self . extent_data ( & extent , * allowance ) ? ; let extent_len = extent_data . len ( ) as u64 ; if extent_len > * allowance { return Err ( ParsingError :: ExtentUnexpectedLength ( extent_len , * allowance ) ) ; } * allowance -= extent_len ; data . append ( & mut extent_data ) ; Ok ( ( ) ) }
Reads extent data from a leaf node.
Reads extent data from a leaf node .
&self
extent
&Extent
data
&mut Vec<u8>
allowance
&mut u64