#[non_exhaustive]pub struct ProducerConfig {
pub op_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.op_ratio: u32How much the ops in a group may cost before a fresh group is emitted.
A new group opens once the pushes and pops already written exceed op_ratio times the
size of the group’s header frame. The pending op is excluded from that check, so the one that
tips the group over budget still lands: a group overshoots by at most one op before rolling.
0 disables ops entirely, so every edit is its own single-frame group.
This is the window’s counterpart to
snapshot::ProducerConfig::delta_ratio, and
the same trade: a bigger ratio spends less on headers and makes a late joiner read more ops.
Defaults to 8.
compression: boolCompress each group as one sync-flushed DEFLATE stream, so every op reuses the header and the ops before it as context.
false (the default) emits plaintext JSON frames. A Decoder reading them
must set ConsumerConfig::compression to match.
Implementations§
Source§impl ProducerConfig
impl ProducerConfig
Sourcepub fn with_op_ratio(self, op_ratio: u32) -> Self
pub fn with_op_ratio(self, op_ratio: u32) -> Self
Set op_ratio (a builder, since the struct is #[non_exhaustive]).
Sourcepub fn with_compression(self, compression: bool) -> Self
pub fn with_compression(self, compression: bool) -> Self
Set compression (a builder, since the struct is #[non_exhaustive]).
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