Struct rmp3::DecoderOwned[][src]

pub struct DecoderOwned<T> { /* fields omitted */ }
This is supported on crate feature std only.

Exactly the same as Decoder, but owns the data. Check Decoder for examples.

Implementations

impl DecoderOwned<Vec<u8>>[src]

pub fn new<T>(source: T) -> Self where
    T: Into<Vec<u8>>, 
[src]

Constructs a new DecoderBox for processing MPEG Audio.

impl<T> DecoderOwned<T>[src]

pub fn into_inner(self) -> T[src]

Consumes the DecoderBox, returning the owned data.

pub fn next<'a>(&'a mut self) -> Option<Frame<'a, 'a>>[src]

Reads the next frame, skipping over potential garbage data.

pub fn peek<'a>(&'a mut self) -> Option<Frame<'a, 'static>>[src]

Reads the next frame without decoding it, or advancing the decoder. Use skip to advance.

This means that the samples will always be empty in Audio, and sample_count should be used to inspect the length.

pub fn position(&self) -> usize[src]

Gets the current position in the input data, starting from 0.

pub fn set_position(&mut self, position: usize)[src]

Sets the current position in the input data.

If position is out of bounds, it's set to the end of the data instead.

pub fn skip(&mut self) -> Option<()>[src]

Skips the current frame the decoder is over, if any.

Trait Implementations

impl<T: AsRef<[u8]>> From<Arc<T>> for DecoderOwned<Arc<T>>[src]

impl<T: AsRef<[u8]>> From<Rc<T>> for DecoderOwned<Rc<T>>[src]

impl<T: Into<Vec<u8>>> From<T> for DecoderOwned<Vec<u8>>[src]

Auto Trait Implementations

impl<T> RefUnwindSafe for DecoderOwned<T> where
    T: RefUnwindSafe

impl<T> Send for DecoderOwned<T> where
    T: Send

impl<T> Sync for DecoderOwned<T> where
    T: Sync

impl<T> Unpin for DecoderOwned<T> where
    T: Unpin

impl<T> UnwindSafe for DecoderOwned<T> where
    T: UnwindSafe

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.