#[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 delta is appended to the current group as long as the
accumulated deltas (excluding the snapshot frame) stay within ratio times the size of a
snapshot; otherwise a new snapshot group is started. So 1 allows deltas totalling up
to one snapshot before rolling, and a larger ratio tolerates more deltas per snapshot.
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