#[non_exhaustive]pub struct Config {
pub max_hops: NonZeroUsize,
pub pool: Pool,
pub cache_duration: Option<Duration>,
pub proxy: bool,
/* private fields */
}Expand description
An origin’s identity plus the cache pool its broadcasts inherit.
Construction config for an origin Producer. The origin passes its
cache::Pool to every broadcast it creates, so every track and group beneath it
shares one budget. Defaults to no byte target and the cache’s standard idle expiry.
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.max_hops: NonZeroUsizeLongest hop path a session using this origin accepts or forwards (default 32).
Legacy: applies to moq-lite-03 through 06 and the negotiated MoQ Cluster extension on moq-transport, and leaves with moq-lite-06. A moq-lite-07 route’s own hops stop at 32 whatever this is, but a route that crossed into moq-lite-07 from moq-lite-06 still carries that chain: with its publisher’s hop appended it must fit this bound, or the route is dropped (logged at debug). A forwarded path counts this origin’s own hop too, including when the receiving peer reconstructs that hop from the announce handshake. Protocols without a hop path cannot reveal or bound the depth they hide. No wire carries a path longer than 32, so a larger value acts as 32.
pool: PoolThe cache pool broadcasts under this origin charge their groups into. It flows
down the ownership chain (origin -> broadcast -> track -> group): a track opens
an account against it, and its groups charge through that. It has no byte target
and uses cache::DEFAULT_EXPIRY by default; a relay sets a shared configured
pool (assign Self::pool) so cached groups across the whole process share
one policy.
cache_duration: Option<Duration>Local ceiling on each track’s max age under this origin.
This caps how long a superseded group stays fresh here, and the delivery budget,
without changing the publisher’s max_age metadata. Wall-clock
reclamation of idle content is separate: Self::pool’s
expiry window. None (the default) imposes no ceiling,
leaving each track’s own window in force.
proxy: boolWhether a moq-lite-07 session on this origin carries its peer’s traffic to other origins: off (the default), a peer is sent only the routes to this node’s own claims; on, the routes it learned from other peers too.
A relay turns it on. An application publishing its own broadcasts leaves it off,
so a peer never routes through it to reach anyone else. On a proxying origin, a
Link::Upstream session still gets routes learned from peers, just none from
other upstreams; a session that must forward nothing needs its own origin with
this off. Older versions advertise everything either way, since their hop chains
cannot tell this node’s claims from what it forwards.
Implementations§
Source§impl Config
impl Config
Sourcepub fn new(node: NonZeroU64) -> Self
pub fn new(node: NonZeroU64) -> Self
Config for the given origin node with no byte target and the default idle expiry.
Behind the test-support feature: a test’s door, not an API. A Node ID kept across
runs would merge them on lite-07.
Sourcepub fn with_update_hold(self, hold: Duration) -> Self
pub fn with_update_hold(self, hold: Duration) -> Self
Hold route updates for hold rather than the default; see the field’s notes.
Behind the test-support feature: a test’s door, not an API.
Sourcepub fn update_hold(&self) -> Duration
pub fn update_hold(&self) -> Duration
How long announce cursors hold a changed route; see Self::with_update_hold.
Behind the test-support feature: a test’s door, not an API.