# [−][src]Struct gif::Reader

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

GIF decoder

## Methods

### `impl<R> Reader<R> where
R: Read,` [src]

#### `pub fn next_frame_info(
&mut self
) -> Result<Option<&Frame<'static>>, DecodingError>`[src]

Returns the next frame info

#### `pub fn read_next_frame(
&mut self
) -> Result<Option<&Frame<'static>>, DecodingError>`[src]

Reads the next frame from the image.

Do not call `Self::next_frame_info` beforehand. Deinterlaces the result.

#### `pub fn read_into_buffer(&mut self, buf: &mut [u8]) -> Result<(), DecodingError>`[src]

Reads the data of the current frame into a pre-allocated buffer.

`Self::next_frame_info` needs to be called beforehand. The length of `buf` must be at least `Self::buffer_size`. Deinterlaces the result.

#### `pub fn fill_buffer(&mut self, buf: &mut [u8]) -> Result<bool, DecodingError>`[src]

Reads data of the current frame into a pre-allocated buffer until the buffer has been filled completely.

`Self::next_frame_info` needs to be called beforehand. Returns `true` if the supplied buffer could be filled completely. Should not be called after `false` had been returned.

#### `pub fn buffer_size(&self) -> usize`[src]

Output buffer size

#### `pub fn line_length(&self) -> usize`[src]

Line length of the current frame

#### `pub fn palette(&self) -> Result<&[u8], DecodingError>`[src]

Returns the color palette relevant for the current (next) frame

#### `pub fn global_palette(&self) -> Option<&[u8]>`[src]

The global color palette

#### `pub fn width(&self) -> u16`[src]

Width of the image

#### `pub fn height(&self) -> u16`[src]

Height of the image

#### `pub fn bg_color(&self) -> Option<usize>`[src]

Index of the background color in the global palette

## Auto Trait Implementations

### `impl<R> Send for Reader<R> where
R: Send,`

### `impl<R> Unpin for Reader<R> where
R: Unpin,`

### `impl<R> Sync for Reader<R> where
R: Sync,`

### `impl<R> UnwindSafe for Reader<R> where
R: UnwindSafe,`

### `impl<R> RefUnwindSafe for Reader<R> where
R: RefUnwindSafe,`

## Blanket Implementations

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

#### `fn into(self) -> U`[src]

Performs the conversion.

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

#### `fn from(t: T) -> T`[src]

Performs the conversion.

### `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.

#### `fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>`[src]

Performs the conversion.

### `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.

#### `fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>`[src]

Performs the conversion.

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

#### `fn borrow_mut(&mut self) -> &mut T`[src]

Mutably borrows from an owned value. Read more

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

#### `fn borrow(&self) -> &T`[src]

Immutably borrows from an owned value. Read more

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

#### `fn type_id(&self) -> TypeId`[src]

Gets the `TypeId` of `self`. Read more

# Help

## Keyboard Shortcuts

`?`
  Show this help dialog
`S`
  Focus the search field
`↑`
  Move up in search results
`↓`
  Move down in search results
`↹`
  Switch tab
`⏎`
  Go to active search result
`+`
  Expand all sections
`-`
  Collapse all sections

## Search Tricks

Prefix searches with a type followed by a colon (e.g., `fn:`) to restrict the search to a given type.

Accepted types are: `fn`, `mod`, `struct`, `enum`, `trait`, `type`, `macro`, and `const`.

Search functions by type signature (e.g., `vec -> usize` or `* -> vec`)

Search multiple things at once by splitting your query with comma (e.g., `str,u8` or `String,struct:Vec,test`)