#[non_exhaustive]pub struct SegmentConfig {
pub flush_policy: FlushPolicy,
pub max_size_bytes: u64,
pub compression_level: i32,
pub cipher: Option<Box<dyn SegmentCipher>>,
}Expand description
Configuration knobs for SegmentBuffer.
This struct is #[non_exhaustive]: new fields may be added in any release
without breaking semver. Construct via SegmentConfig::builder() and then
mutate the public fields you care about, or use SegmentConfig::default()
directly:
use segment_buffer::SegmentConfig;
let mut config = SegmentConfig::default();
config.max_size_bytes = 1024 * 1024;Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Non-exhaustive structs could have additional fields added in future. Therefore, non-exhaustive structs cannot be constructed in external crates using the traditional
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.flush_policy: FlushPolicyWhen to auto-flush pending items. See FlushPolicy for the options.
max_size_bytes: u64Max total disk usage before the buffer reports overload pressure (default: 10 GB).
compression_level: i32zstd compression level (1-22; 3 is fast with a good ratio).
cipher: Option<Box<dyn SegmentCipher>>Optional cipher for encrypting segment files at rest. When None,
segments are written as plaintext zstd+CBOR.
Implementations§
Source§impl SegmentConfig
impl SegmentConfig
Sourcepub fn builder() -> SegmentConfigBuilder
pub fn builder() -> SegmentConfigBuilder
Begin a builder. Every field starts at SegmentConfig::default;
chain setter calls to override the ones you care about.
Trait Implementations§
Source§impl Debug for SegmentConfig
impl Debug for SegmentConfig
Auto Trait Implementations§
impl !RefUnwindSafe for SegmentConfig
impl !UnwindSafe for SegmentConfig
impl Freeze for SegmentConfig
impl Send for SegmentConfig
impl Sync for SegmentConfig
impl Unpin for SegmentConfig
impl UnsafeUnpin for SegmentConfig
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