pub struct Context<M: Muxer + Send, W: Write> {
pub user_private: Option<Box<dyn Any + Send + Sync>>,
/* private fields */
}Expand description
Auxiliary structure to encapsulate a muxer object and its additional data.
Fields§
§user_private: Option<Box<dyn Any + Send + Sync>>User private data.
This data cannot be cloned.
Implementations§
Source§impl<M: Muxer, W: Write> Context<M, W>
impl<M: Muxer, W: Write> Context<M, W>
Sourcepub fn write_header(&mut self) -> Result<()>
pub fn write_header(&mut self) -> Result<()>
Writes a stream header to an internal buffer and returns how many bytes were written or an error.
Sourcepub fn write_packet(&mut self, pkt: Arc<Packet>) -> Result<()>
pub fn write_packet(&mut self, pkt: Arc<Packet>) -> Result<()>
Writes a stream packet to an internal buffer and returns how many bytes were written or an error.
Sourcepub fn write_trailer(&mut self) -> Result<()>
pub fn write_trailer(&mut self) -> Result<()>
Writes a stream trailer to an internal buffer and returns how many bytes were written or an error.
Sourcepub fn set_global_info(&mut self, info: GlobalInfo) -> Result<()>
pub fn set_global_info(&mut self, info: GlobalInfo) -> Result<()>
Sets global media file information for a muxer.
Sourcepub fn set_option<'a, V>(&mut self, key: &str, val: V) -> Result<()>
pub fn set_option<'a, V>(&mut self, key: &str, val: V) -> Result<()>
Sets a muxer option.
This method should be called as many times as the number of options present in a muxer.
Sourcepub fn into_writer(self) -> Writer<W> ⓘ
pub fn into_writer(self) -> Writer<W> ⓘ
Consumes this muxer and returns the underlying writer.
Auto Trait Implementations§
impl<M, W> Freeze for Context<M, W>
impl<M, W> !RefUnwindSafe for Context<M, W>
impl<M, W> Send for Context<M, W>where
W: Send,
impl<M, W> Sync for Context<M, W>
impl<M, W> Unpin for Context<M, W>
impl<M, W> !UnwindSafe for Context<M, W>
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