pub struct Context<D: Decoder> { /* private fields */ }Expand description
Auxiliary structure to encapsulate a decoder object and its additional data.
Implementations§
Source§impl<D: Decoder> Context<D>
impl<D: Decoder> Context<D>
Sourcepub fn by_name<T: Descriptor<OutputDecoder = D> + ?Sized>(
codecs: &Codecs<T>,
name: &str,
) -> Option<Self>
pub fn by_name<T: Descriptor<OutputDecoder = D> + ?Sized>( codecs: &Codecs<T>, name: &str, ) -> Option<Self>
Retrieves a codec descriptor from a codec list through its name,
creates the relative decoder, and encapsulates it into a new Context.
Sourcepub fn set_extradata(&mut self, extra: &[u8])
pub fn set_extradata(&mut self, extra: &[u8])
Saves the extra data contained in a codec.
Sourcepub fn send_packet(&mut self, pkt: &Packet) -> Result<()>
pub fn send_packet(&mut self, pkt: &Packet) -> Result<()>
Sends to the decoder a packet to be decoded.
Sourcepub fn receive_frame(&mut self) -> Result<ArcFrame>
pub fn receive_frame(&mut self) -> Result<ArcFrame>
Returns a decoded frame.
Auto Trait Implementations§
impl<D> Freeze for Context<D>where
D: Freeze,
impl<D> RefUnwindSafe for Context<D>where
D: RefUnwindSafe,
impl<D> Send for Context<D>
impl<D> Sync for Context<D>
impl<D> Unpin for Context<D>where
D: Unpin,
impl<D> UnwindSafe for Context<D>where
D: 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