#[non_exhaustive]pub struct ProducerConfig {
pub delta_ratio: u32,
pub compression: bool,
}Expand description
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.delta_ratio: u32Controls how aggressively the producer emits deltas (merge patches) instead of full snapshots.
A ratio of 0 disables deltas: every change is published as a new snapshot group.
A positive ratio enables deltas. A new snapshot group is started once the deltas already
written to the current group (excluding the snapshot frame) exceed ratio times the snapshot
size. The pending delta is excluded from that check, so the one that first crosses the budget
still lands before the group rolls. So 1 allows roughly one snapshot’s worth of deltas before
rolling, and a larger ratio tolerates more.
When compression is on, both sides of the comparison are measured on
the compressed frame sizes (the real wire cost).
Defaults to 8.
compression: boolCompress each group as one sync-flushed DEFLATE stream, so deltas reuse the snapshot as context and shrink sharply.
false (the default) writes plaintext JSON frames, identical on the wire to an uncompressed
track. A Consumer reading the track must set ConsumerConfig::compression to match.
Trait Implementations§
Source§impl Clone for ProducerConfig
impl Clone for ProducerConfig
Source§fn clone(&self) -> ProducerConfig
fn clone(&self) -> ProducerConfig
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more