fn block(&self, block_number: u64) -> Result<Box<[u8]>, ParsingError> {
        if block_number == 0 {
            return Err(ParsingError::InvalidAddress(
                InvalidAddressErrorType::Lower,
                0,
                FIRST_BG_PADDING,
            ));
        }
        let block_size = self.block_size()?;
        let address = block_number
            .checked_mul(block_size)
            .ok_or(ParsingError::BlockNumberOutOfBounds(block_number))?;

        let mut data = vec![0u8; block_size.try_into().unwrap()];
        self.reader.read(address, data.as_mut_slice()).map_err(Into::<ParsingError>::into)?;

        Ok(data.into_boxed_slice())
    }
/// Reads full raw data from a given block number.
Reads full raw data from a given block number.
Reads full raw data from a given block number .
fn block(&self, block_number: u64) -> Result<Box<[u8]>, ParsingError> {
        if block_number == 0 {
            return Err(ParsingError::InvalidAddress(
                InvalidAddressErrorType::Lower,
                0,
                FIRST_BG_PADDING,
            ));
        }
        let block_size = self.block_size()?;
        let address = block_number
            .checked_mul(block_size)
            .ok_or(ParsingError::BlockNumberOutOfBounds(block_number))?;
        let mut data = vec![0u8; block_size.try_into().unwrap()];
        self.reader.read(address, data.as_mut_slice()).map_err(Into::<ParsingError>::into)?;
        Ok(data.into_boxed_slice())
    }
fn block ( & self , block_number : u64 ) -> Result < Box < [ u8 ] > , ParsingError > { if block_number == 0 { return Err ( ParsingError :: InvalidAddress ( InvalidAddressErrorType :: Lower , 0 , FIRST_BG_PADDING , ) ) ; } let block_size = self . block_size ( ) ? ; let address = block_number . checked_mul ( block_size ) . ok_or ( ParsingError :: BlockNumberOutOfBounds ( block_number ) ) ? ; let mut data = vec ! [ 0u8 block_size try_into ( ) unwrap ( ) ] ; self . reader . read ( address , data . as_mut_slice ( ) ) . map_err ( Into :: < ParsingError > :: into ) ? ; Ok ( data . into_boxed_slice ( ) ) }
Reads full raw data from a given block number.
Reads full raw data from a given block number .
&self
block_number
u64
&self
block_number
u64