#[non_exhaustive]pub struct Config {
pub deltas: bool,
pub max_group_bytes: u64,
}Expand description
Codec options for an Encoder, and so for the Producer wrapping one.
Build from Default and override fields (the struct is #[non_exhaustive], so new
options stay additive), or chain with_deltas.
How long a group runs is not a codec option: a group grows until a joiner wants a fresh one,
judged by the track’s refresh ratio, or until it reaches
the frame or byte cap.
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.deltas: boolWhether changes ride as merge-patch deltas in the open group.
false makes every change its own single-frame snapshot group, identical on the wire to a
plain “one JSON blob per group” track, so refresh never applies.
Defaults to true.
max_group_bytes: u64The most bytes a group may hold, snapshot and deltas together.
A delta that would pass it rolls a fresh snapshot instead, and a snapshot past it is refused
with FrameTooLarge. Lowering it lets a test reach the limit
without megabytes of JSON; a value above 32 MiB, what moq-net’s group cache holds, is clamped
to it.
Defaults to 32 MiB.
Implementations§
Source§impl Config
impl Config
Sourcepub fn with_deltas(self, deltas: bool) -> Self
pub fn with_deltas(self, deltas: bool) -> Self
Set deltas (a builder, since the struct is #[non_exhaustive]).
Sourcepub fn with_max_group_bytes(self, max_group_bytes: u64) -> Self
pub fn with_max_group_bytes(self, max_group_bytes: u64) -> Self
Set max_group_bytes.