pub struct EncodeSource<S> { /* private fields */ }Expand description
Owned encode-side handoff that keeps metadata and the PCM stream together.
Most explicit encode workflows construct one of these from a reader’s
into_source method and then pass it to
crate::Encoder::encode_source.
Implementations§
Source§impl<S> EncodeSource<S>
impl<S> EncodeSource<S>
Sourcepub fn new(metadata: Metadata, stream: S) -> Self
pub fn new(metadata: Metadata, stream: S) -> Self
Create a new encode source from staged metadata and a PCM stream.
Sourcepub fn metadata_mut(&mut self) -> &mut Metadata
pub fn metadata_mut(&mut self) -> &mut Metadata
Return mutable access to the staged encode metadata.
Sourcepub fn with_metadata(self, metadata: Metadata) -> Self
pub fn with_metadata(self, metadata: Metadata) -> Self
Replace the staged metadata and return the updated source.
Sourcepub fn into_parts(self) -> (Metadata, S)
pub fn into_parts(self) -> (Metadata, S)
Consume the source and return the metadata and stream.
Source§impl<S: EncodePcmStream> EncodeSource<S>
impl<S: EncodePcmStream> EncodeSource<S>
Auto Trait Implementations§
impl<S> Freeze for EncodeSource<S>where
S: Freeze,
impl<S> RefUnwindSafe for EncodeSource<S>where
S: RefUnwindSafe,
impl<S> Send for EncodeSource<S>where
S: Send,
impl<S> Sync for EncodeSource<S>where
S: Sync,
impl<S> Unpin for EncodeSource<S>where
S: Unpin,
impl<S> UnsafeUnpin for EncodeSource<S>where
S: UnsafeUnpin,
impl<S> UnwindSafe for EncodeSource<S>where
S: UnwindSafe,
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more