Struct riff::Chunk [−][src]
pub struct Chunk { pub id: ChunkId, pub content: ChunkContent, }
A chunk, also known as a form
Fields
id: ChunkId
The id of the chunk
content: ChunkContent
The contents of the chunk
Methods
impl Chunk
[src]
impl Chunk
pub fn new_riff(form_id: ChunkId, content: Vec<Chunk>) -> Chunk
[src]
pub fn new_riff(form_id: ChunkId, content: Vec<Chunk>) -> Chunk
Creates a new RIFF chunk.
Examples
let data_id = riff::ChunkId::new("test")?; let riff_id = riff::ChunkId::new("foo ")?; let data_chunk = riff::Chunk::new_data(data_id, vec![0x00, 0x00]); let riff_chunk = riff::Chunk::new_list(riff_id, vec![data_chunk]);
pub fn new_list(form_id: ChunkId, content: Vec<Chunk>) -> Chunk
[src]
pub fn new_list(form_id: ChunkId, content: Vec<Chunk>) -> Chunk
Creates a new LIST chunk.
Examples
let data_id = riff::ChunkId::new("test")?; let list_id = riff::ChunkId::new("foo ")?; let data_chunk = riff::Chunk::new_data(data_id, vec![0x00, 0x00]); let list_chunk = riff::Chunk::new_list(list_id, vec![data_chunk]);
pub fn new_seqt(form_id: ChunkId, content: Vec<Chunk>) -> Chunk
[src]
pub fn new_seqt(form_id: ChunkId, content: Vec<Chunk>) -> Chunk
Creates a new seqt chunk.
Examples
let data_id = riff::ChunkId::new("test")?; let seqt_id = riff::ChunkId::new("foo ")?; let data_chunk = riff::Chunk::new_data(data_id, vec![0x00, 0x00]); let seqt_chunk = riff::Chunk::new_seqt(seqt_id, vec![data_chunk]);
pub fn new_data(form_id: ChunkId, content: Vec<u8>) -> Chunk
[src]
pub fn new_data(form_id: ChunkId, content: Vec<u8>) -> Chunk
Creates a new data chunk.
Examples
let id = riff::ChunkId::new("test")?; let chunk = riff::Chunk::new_data(id, vec![0x00, 0x00]);
Trait Implementations
impl PartialEq for Chunk
[src]
impl PartialEq for Chunk
fn eq(&self, other: &Chunk) -> bool
[src]
fn eq(&self, other: &Chunk) -> bool
This method tests for self
and other
values to be equal, and is used by ==
. Read more
fn ne(&self, other: &Chunk) -> bool
[src]
fn ne(&self, other: &Chunk) -> bool
This method tests for !=
.
impl Eq for Chunk
[src]
impl Eq for Chunk
impl Debug for Chunk
[src]
impl Debug for Chunk