#[non_exhaustive]pub struct Config {
pub prefix: PathOwned,
pub depth: usize,
pub compression: bool,
}Expand description
Configuration for an Consumer. Construct with Config::new and chain
the with_* setters.
The prefix and depth must match the producing side’s
ProducerConfig: they are how announced paths are
recognized as node broadcasts and filtered from sibling categories under the
same prefix.
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.prefix: PathOwnedTop-level path stats are published under (default .stats). Must match
the producer’s prefix.
depth: usizeThe producer’s grouping depth (default 0). Announced paths whose group
is deeper than this are not recognized as node broadcasts and are
skipped. Must match the producer’s depth.
compression: boolRead the compressed .json.z tracks instead of the plain .json ones.
Same data for a fraction of the bytes, but requires a producer that
publishes them. Defaults to false.
Implementations§
Source§impl Config
impl Config
Sourcepub fn new() -> Self
pub fn new() -> Self
A config with default settings: the .stats prefix, depth 0, and the
plain .json tracks.
Sourcepub fn with_prefix(self, prefix: impl Into<PathOwned>) -> Self
pub fn with_prefix(self, prefix: impl Into<PathOwned>) -> Self
Override the top-level prefix (default .stats). Must match the producer.
Sourcepub fn with_depth(self, depth: usize) -> Self
pub fn with_depth(self, depth: usize) -> Self
Override the grouping depth (default 0). Must match the producer.
Sourcepub fn with_compression(self, compression: bool) -> Self
pub fn with_compression(self, compression: bool) -> Self
Read the compressed .json.z tracks instead of the plain .json ones.