oxirs-cluster 0.2.4

Raft-backed distributed dataset for high availability and horizontal scaling
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
//! # RegionManager - compress_for_transfer_group Methods
//!
//! This module contains method implementations for `RegionManager`.
//!
//! 🤖 Generated with [SplitRS](https://github.com/cool-japan/splitrs)

use crate::error::Result as ClusterResult;

use super::regionmanager_type::RegionManager;

impl RegionManager {
    /// Compress data for cross-region transfer using zstd
    pub fn compress_for_transfer(&self, data: &[u8]) -> ClusterResult<Vec<u8>> {
        oxiarc_zstd::encode_all(data, 3)
            .map_err(|e| crate::error::ClusterError::Compression(e.to_string()))
    }
}