pub struct ByteStorage { /* private fields */ }Expand description
Raw byte storage engine (pure Rust core) Simple store/retrieve interface with no type awareness
Implementations§
Source§impl ByteStorage
impl ByteStorage
Sourcepub fn store(
&self,
data: &[u8],
format: Option<String>,
) -> Result<Vec<u8>, ByteStorageError>
pub fn store( &self, data: &[u8], format: Option<String>, ) -> Result<Vec<u8>, ByteStorageError>
Store arbitrary bytes with compression and checksums
Returns serialized StorageEnvelope bytes
Sourcepub fn retrieve(
&self,
envelope_bytes: &[u8],
) -> Result<(Vec<u8>, String), ByteStorageError>
pub fn retrieve( &self, envelope_bytes: &[u8], ) -> Result<(Vec<u8>, String), ByteStorageError>
Retrieve and validate stored bytes
Returns (original_data, format_identifier)
Sourcepub fn estimate_compression(&self, data: &[u8]) -> Result<f64, ByteStorageError>
pub fn estimate_compression(&self, data: &[u8]) -> Result<f64, ByteStorageError>
Get compression ratio for given data
Sourcepub fn validate(&self, envelope_bytes: &[u8]) -> bool
pub fn validate(&self, envelope_bytes: &[u8]) -> bool
Validate envelope without extracting data
Sourcepub fn get_last_metrics(&self) -> OperationMetrics
pub fn get_last_metrics(&self) -> OperationMetrics
Get metrics from last operation
Returns a snapshot of metrics from the most recent store() or retrieve() call
Sourcepub fn max_uncompressed_size(&self) -> usize
pub fn max_uncompressed_size(&self) -> usize
Get security limits