Trait fitsrs::hdu::data::DataBufRead
source · pub trait DataBufRead<'a, X>: BufReadwhere
X: Xtension,{
type Data: Access + Debug;
// Required methods
fn new_data_block(&'a mut self, ctx: &X) -> Self::Data
where Self: Sized;
fn consume_data_block(
data: Self::Data,
num_bytes_read: &mut u64
) -> Result<&'a mut Self, Error>;
// Provided method
fn read_n_bytes_exact(
&mut self,
num_bytes_to_read: u64
) -> Result<(), Error> { ... }
}
Required Associated Types§
Required Methods§
fn new_data_block(&'a mut self, ctx: &X) -> Self::Datawhere Self: Sized,
sourcefn consume_data_block(
data: Self::Data,
num_bytes_read: &mut u64
) -> Result<&'a mut Self, Error>
fn consume_data_block( data: Self::Data, num_bytes_read: &mut u64 ) -> Result<&'a mut Self, Error>
Consume the data to return back the reader at the position of the end of the data block
If the data has not been fully read, we skip the remaining data bytes to go to the end of the data block
Params
data
- a reader created i.e. from the opening of a file