[−][src]Struct riffu::builder::riff::ChunkBuilder
Helper struct to help user creates chunks.
NOTE
- Add lots and lots of error checking. Since
Vec
useusize
internally, we have to limit it tou32
. In similar vein, we also need to check for overflow and stuff, especially during subtraction. - Should we separate Type and NoType? We currently represent these types at the most raw level (literally as
Vec<u8>
) which is quite hard to deal with. - Should we lazily calculate the size of the payload or do we want to precalculate the payload as we append chunks. The latter method is error prone because a user could append to an inner chunk and the parent chunk would have no way of knowing about this size increase.
Fields
chunk_id: FourCC
payload_len: u32
chunk_type: Option<FourCC>
data: ChunkData
Implementations
impl ChunkBuilder
[src]
pub fn new_notype(id: FourCC, data: ChunkData) -> Self
[src]
Creates a chunk from a FourCC
and a ChunkData
that does not contain a 4 bytes identifier for the chunk type.
pub fn new_type(id: FourCC, chunk_type: FourCC, data: ChunkData) -> Self
[src]
Creates a chunk from 2 FourCC
s and a ChunkData
that uses the second FourCC
and the chunk's type identifier.
pub fn add_chunk(self, chunk: ChunkBuilder) -> RiffResult<Self>
[src]
Adds a chunk children to this chunk.
Trait Implementations
Auto Trait Implementations
impl RefUnwindSafe for ChunkBuilder
impl Send for ChunkBuilder
impl Sync for ChunkBuilder
impl Unpin for ChunkBuilder
impl UnwindSafe for ChunkBuilder
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
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]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,