Skip to main content

Config

Struct Config 

Source
#[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
Non-exhaustive structs could have additional fields added in future. Therefore, non-exhaustive structs cannot be constructed in external crates using the traditional Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.
§max_hops: NonZeroUsize

Longest 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: Pool

The 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: bool

Whether 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

Source

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.

Source

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.

Source

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.

Trait Implementations§

Source§

impl Clone for Config

Source§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for Config

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Default for Config

Source§

fn default() -> Self

A node minted per origin, with no byte target and the default idle expiry.

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self> ⓘ

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self> ⓘ

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> Pointable for T

Source§

const ALIGN: usize

The alignment of pointer.
Source§

type Init = T

The type for initializers.
Source§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
Source§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
Source§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
Source§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> ⓘ
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self> ⓘ

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more