Struct rubbl_fits::FitsDecoder[][src]

pub struct FitsDecoder<R: Read> { /* fields omitted */ }

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

impl<R: Read> FitsDecoder<R>[src]

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.

pub fn new(inner: R) -> Self[src]

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

pub fn next<'a>(&'a mut self) -> Result<Option<LowLevelFitsItem<'a>>, Error>[src]

Get the next item in the FITS stream.

Returns Ok(None) at an expected EOF.

pub fn into_inner(self) -> R[src]

Consume this decoder and return the inner Read object.

Trait Implementations

impl<R: Clone + Read> Clone for FitsDecoder<R>[src]

Auto Trait Implementations

impl<R> RefUnwindSafe for FitsDecoder<R> where
    R: RefUnwindSafe

impl<R> Send for FitsDecoder<R> where
    R: Send

impl<R> Sync for FitsDecoder<R> where
    R: Sync

impl<R> Unpin for FitsDecoder<R> where
    R: Unpin

impl<R> UnwindSafe for FitsDecoder<R> where
    R: UnwindSafe

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.