[][src]Struct riff::ChunkId

pub struct ChunkId {
    pub value: [u8; 4],
}

A chunk id, also known as FourCC

Fields

value: [u8; 4]

The raw bytes of the id

Implementations

impl ChunkId[src]

pub fn as_str(&self) -> &str[src]

Returns the value of the id as a string.

Examples

assert_eq!(riff::RIFF_ID.as_str(), "RIFF");

Panics

This function panics when the value does not represent a valid UTF-8 string.

pub fn new(s: &str) -> Result<ChunkId, &str>[src]

Creates a new ChunkId from a string.

Examples

let chunk_id = riff::ChunkId::new("RIFF")?;

Errors

The function fails when the string's length in bytes is not exactly 4.

Trait Implementations

impl Clone for ChunkId[src]

impl Debug for ChunkId[src]

impl Display for ChunkId[src]

impl Eq for ChunkId[src]

impl PartialEq<ChunkId> for ChunkId[src]

impl StructuralEq for ChunkId[src]

impl StructuralPartialEq for ChunkId[src]

Auto Trait Implementations

impl RefUnwindSafe for ChunkId

impl Send for ChunkId

impl Sync for ChunkId

impl Unpin for ChunkId

impl UnwindSafe for ChunkId

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> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T> ToString for T where
    T: Display + ?Sized
[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.