[][src]Struct riff::Chunk

pub struct Chunk { /* fields omitted */ }

A chunk, also known as a form

Implementations

impl Chunk[src]

pub fn id(&self) -> ChunkId[src]

Returns the ChunkId of this chunk.

pub fn len(&self) -> u32[src]

Returns the number of bytes in this chunk.

pub fn offset(&self) -> u64[src]

Returns the offset of this chunk from the start of the stream.

pub fn read_type<T>(&self, stream: &mut T) -> Result<ChunkId> where
    T: Read + Seek
[src]

Reads the chunk type of this chunk.

Generally only valid for RIFF and LIST chunks.

pub fn read<T>(stream: &mut T, pos: u64) -> Result<Chunk> where
    T: Read + Seek
[src]

Reads a chunk from the specified position in the stream.

pub fn read_contents<T>(&self, stream: &mut T) -> Result<Vec<u8>> where
    T: Read + Seek
[src]

Reads the entirety of the contents of a chunk.

pub fn iter<'a, T>(&self, stream: &'a mut T) -> Iter<'a, T>

Important traits for Iter<'a, T>

impl<'a, T> Iterator for Iter<'a, T> where
    T: Seek + Read
type Item = Chunk;
where
    T: Seek + Read
[src]

Returns an iterator over the children of the chunk.

If the chunk has children but is noncompliant, e.g. it has no type identifier (like seqt chunks), use iter_no_type instead.

pub fn iter_no_type<'a, T>(&self, stream: &'a mut T) -> Iter<'a, T>

Important traits for Iter<'a, T>

impl<'a, T> Iterator for Iter<'a, T> where
    T: Seek + Read
type Item = Chunk;
where
    T: Seek + Read
[src]

Returns an iterator over the chilren of the chunk. Only valid for noncompliant chunks that have children but no chunk type identifier (like seqt chunks).

Trait Implementations

impl Debug for Chunk[src]

impl Eq for Chunk[src]

impl PartialEq<Chunk> for Chunk[src]

impl StructuralEq for Chunk[src]

impl StructuralPartialEq for Chunk[src]

Auto Trait Implementations

impl RefUnwindSafe for Chunk

impl Send for Chunk

impl Sync for Chunk

impl Unpin for Chunk

impl UnwindSafe for Chunk

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, 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.