pub struct SecureCompressedData {
pub data: Vec<u8>,
pub original_size: usize,
pub compression_ratio: f64,
pub codec: ByteCodec,
}Expand description
Compressed bytes with security metadata and codec identification.
§In-process only
This struct is intended for in-process use only and is not a wire format.
The codec field is carried alongside data so that SecureCompressor::decompress_protected
always uses the correct decoder. If this type must cross process boundaries in the future,
design a versioned framing header as a separate concern.
Fields§
§data: Vec<u8>The compressed (or verbatim) payload.
original_size: usizeOriginal uncompressed size in bytes.
compression_ratio: f64Compression ratio: original_size / compressed_size.
A value of 2.0 means the compressed payload is half the original size (50% size reduction).
For ByteCodec::None this is always 1.0; for incompressible data it can be < 1.0
because most codecs add a small framing header.
codec: ByteCodecCodec used to produce data. Must be passed back to SecureCompressor::decompress_protected.
Trait Implementations§
Source§impl Clone for SecureCompressedData
impl Clone for SecureCompressedData
Source§fn clone(&self) -> SecureCompressedData
fn clone(&self) -> SecureCompressedData
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreAuto Trait Implementations§
impl Freeze for SecureCompressedData
impl RefUnwindSafe for SecureCompressedData
impl Send for SecureCompressedData
impl Sync for SecureCompressedData
impl Unpin for SecureCompressedData
impl UnsafeUnpin for SecureCompressedData
impl UnwindSafe for SecureCompressedData
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more