pub struct Decoder<C = Identity, E = Identity> { /* private fields */ }Expand description
Synchronous frame decoder. It knows no logical ranges or I/O offsets. Authentication precedes decompression. Reuse one instance and the caller’s buffer to amortize allocations. Compression may swap the buffer allocation.
Implementations§
Source§impl<C: CompressionCodec, E: EncryptionCodec> Decoder<C, E>
impl<C: CompressionCodec, E: EncryptionCodec> Decoder<C, E>
Sourcepub fn new(config: Config, compression: C, encryption: E) -> Result<Self>
pub fn new(config: Config, compression: C, encryption: E) -> Result<Self>
Create a decoder matching the object’s metadata and the supplied key.
Sourcepub fn decode_frame(
&mut self,
spec: FrameSpec,
buffer: &mut Vec<u8>,
) -> Result<()>
pub fn decode_frame( &mut self, spec: FrameSpec, buffer: &mut Vec<u8>, ) -> Result<()>
Replace one complete stored frame with its complete decoded bytes. On failure the buffer is cleared. No unauthenticated bytes are returned. Clearing the buffer is not a promise to zero its allocation or scratch.
Auto Trait Implementations§
impl<C, E> Freeze for Decoder<C, E>
impl<C, E> RefUnwindSafe for Decoder<C, E>where
C: RefUnwindSafe,
E: RefUnwindSafe,
impl<C, E> Send for Decoder<C, E>
impl<C, E> Sync for Decoder<C, E>
impl<C, E> Unpin for Decoder<C, E>
impl<C, E> UnsafeUnpin for Decoder<C, E>where
C: UnsafeUnpin,
E: UnsafeUnpin,
impl<C, E> UnwindSafe for Decoder<C, E>where
C: UnwindSafe,
E: 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