[][src]Struct gift::Decoder

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

A builder which can be turned into either a BlockDecoder or a FrameDecoder.

Example

let mut frame_dec = gift::Decoder::new(gif).into_frame_decoder();
let preamble = frame_dec.preamble()?;
println!("preamble: {:?}", preamble);
for frame in frame_dec {
    println!("frame: {:?}", frame?);
}

Methods

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

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

Create a new Decoder

pub fn max_image_sz(self, max_image_sz: Option<usize>) -> Self[src]

Set the maximum image size (in bytes) to allow for decoding.

Important traits for FrameDecoder<R>
pub fn into_frame_decoder(self) -> FrameDecoder<R>[src]

Convert the decoder into a frame decoder.

Trait Implementations

impl<R: Read> IntoIterator for Decoder<R>[src]

type Item = Result<Block, DecodeError>

The type of the elements being iterated over.

type IntoIter = BlockDecoder<R>

Which kind of iterator are we turning this into?

fn into_iter(self) -> Self::IntoIter[src]

Convert the decoder into a block decoder

Auto Trait Implementations

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

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

Blanket Implementations

impl<T> From for T[src]

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

impl<I> IntoIterator for I where
    I: Iterator
[src]

type Item = <I as Iterator>::Item

The type of the elements being iterated over.

type IntoIter = I

Which kind of iterator are we turning this into?

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

type Error = Infallible

The type returned in the event of a conversion error.

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

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

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

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

The type returned in the event of a conversion error.

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