#[non_exhaustive]pub struct SegmentConfig {
pub max_batch_events: usize,
pub flush_interval_secs: u64,
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::default() and then
mutate the public fields you care about:
use segment_buffer::SegmentConfig;
let mut config = SegmentConfig::default();
config.max_batch_events = 64;
config.flush_interval_secs = 1;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.max_batch_events: usizeMax events accumulated in RAM before auto-flush (default: 256).
flush_interval_secs: u64Max seconds between flushes. An append after this interval triggers a flush even if the batch threshold hasn’t been reached (default: 5s).
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.
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