Struct rubbl_fits::FitsDecoder

source ·
pub struct FitsDecoder<R: Read> { /* private fields */ }
Expand description

A decoder for single-pass streaming of a FITS file.

This struct decodes its input stream assuming it is in FITS format. The decoding is extremely low-level; only enough work is done to separate the stream into headers and data correctly. The underlying stream need only implement Read, and the items that are streamed out are well-suited for reproducing the input file byte-for-byte.

This class is not very picking about checking FITS conformity.

Implementations§

Note that we can’t implement our I/O paradigm using Iterator because Rust’s iterators aren’t “streaming”: basically, the Rust paradigm is that you can look at multiple iterator items at once, which isn’t compatible with our desire to be zero-copy and return byte slices rather than allocate vecs. See this discussion.

Create a new decoder that gets data from the Read type passed as an argument.

Get the next item in the FITS stream.

Returns Ok(None) at an expected EOF.

Consume this decoder and return the inner Read object.

Trait Implementations§

Returns a copy of the value. Read more
Performs copy-assignment from source. Read more

Auto Trait Implementations§

Blanket Implementations§

Gets the TypeId of self. Read more
Immutably borrows from an owned value. Read more
Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

The resulting type after obtaining ownership.
Creates owned data from borrowed data, usually by cloning. Read more
Uses borrowed data to replace owned data, usually by cloning. Read more
The type returned in the event of a conversion error.
Performs the conversion.
The type returned in the event of a conversion error.
Performs the conversion.