pub struct RiffChunk { /* private fields */ }
Expand description
The representation of a RIFF chunk
Implementations
sourceimpl RiffChunk
impl RiffChunk
sourcepub fn from_bytes(b: Bytes) -> Result<RiffChunk>
pub fn from_bytes(b: Bytes) -> Result<RiffChunk>
Create a new RiffChunk
image from a Reader.
Errors
This method fails if the file signature doesn’t match or one of the chunks is corrupted or truncated.
sourcepub fn content(&self) -> &RiffContent
pub fn content(&self) -> &RiffContent
Get the content of this RiffChunk
sourcepub fn content_mut(&mut self) -> &mut RiffContent
pub fn content_mut(&mut self) -> &mut RiffContent
Get a mutable reference to the content of this RiffChunk
sourcepub fn len(&self) -> u32
pub fn len(&self) -> u32
Get the total size of this RiffChunk
once it is encoded.
The size is the sum of:
- The chunk id (4 bytes).
- The size field (4 bytes).
- The size of the content + a single padding byte if the size is odd.
sourcepub fn encoder(self) -> ImageEncoder<Self>ⓘNotable traits for ImageEncoder<I>impl<I: EncodeAt> Iterator for ImageEncoder<I> type Item = Bytes;
pub fn encoder(self) -> ImageEncoder<Self>ⓘNotable traits for ImageEncoder<I>impl<I: EncodeAt> Iterator for ImageEncoder<I> type Item = Bytes;
Returns an encoder for this RiffChunk
Trait Implementations
impl StructuralPartialEq for RiffChunk
Auto Trait Implementations
impl RefUnwindSafe for RiffChunk
impl Send for RiffChunk
impl Sync for RiffChunk
impl Unpin for RiffChunk
impl UnwindSafe for RiffChunk
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more