pub struct RouteOptions { /* private fields */ }Expand description
How an application advertises a Route: its visibility at creation, its price,
its credential, and, rarely, a stable identity.
The default announces at once, at cost 0, under the session’s scope, serving a fresh random identity minted when the route is created.
Implementations§
Source§impl RouteOptions
impl RouteOptions
Create the route hidden: it exists for nobody until Route::announce.
For a publisher that fills its catalog first, or answers a negotiation, before readers may find it.
Sourcepub fn with_cost(self, cost: impl Into<Cost>) -> Self
pub fn with_cost(self, cost: impl Into<Cost>) -> Self
Set the cost: lower wins among routes covering the same prefix and anonymity. A publisher prices content it already produces at zero, and content it would have to start producing on demand higher.
Sourcepub fn with_auth(self, auth: Credential) -> Self
pub fn with_auth(self, auth: Credential) -> Self
Set the credential the advertising request carries, from auth::Handle::add.
Only a session built on the handle that issued it presents it, as the token on its moq-transport PUBLISH_NAMESPACE; every other session advertises the route under its own scope.
Sourcepub fn with_identity(self, identity: Identity, epoch: u64) -> Self
pub fn with_identity(self, identity: Identity, epoch: u64) -> Self
Serve a stable identity at epoch, in place of a freshly minted one.
Only for a publisher that continues the identity’s key space across restarts,
announcing a higher epoch each time, such as a counter persisted on disk. Readers
stitch every route of one identity together, so a publisher that restarts its
group keys under an old identity splices unrelated groups into their tracks.
The highest epoch wins over every older one of the identity, cheaper or not.
Naming an identity grants nothing: publishing still needs the path’s grant.