Struct UnpublishOnDrop
pub struct UnpublishOnDrop { /* private fields */ }Expand description
A Publication that is unpublished when this guard drops.
Returned by Publication::unpublish_on_drop. Derefs to the publication.
Implementations§
§impl UnpublishOnDrop
impl UnpublishOnDrop
pub fn disarm(self) -> Publication
pub fn disarm(self) -> Publication
Returns the publication, which then stays published when the guard drops.
Methods from Deref<Target = Publication>§
pub fn ticket(&self) -> BroadcastTicket
pub fn ticket(&self) -> BroadcastTicket
Returns the ticket that names this publication.
It holds the node’s endpoint id and the path, and nothing about layouts.
pub fn broadcast(&self) -> &Producer
pub fn broadcast(&self) -> &Producer
Returns the broadcast to fill.
Tracks created here are what peers read. Closing it withdraws the publication.
pub async fn withdrawn(&self)
pub async fn withdrawn(&self)
Waits until the publication is withdrawn.
Cancellation safe: dropping the future loses nothing.
pub fn is_withdrawn(&self) -> bool
pub fn is_withdrawn(&self) -> bool
Reports whether the publication has been withdrawn.
pub fn set_audience(&self, audience: Audience<PublicKey>)
pub fn set_audience(&self, audience: Audience<PublicKey>)
Changes who may see the publication.
Takes effect on every live session at once: a peer that may no longer
see it loses the path, and what it reads there ends with
moq_net::Error::Unauthorized. Does nothing once withdrawn.
§Panics
Panics when called outside a Tokio runtime.
pub fn unpublish(&self)
pub fn unpublish(&self)
Withdraws the publication from every link and from the route table.
Peers lose the path, and what they read there ends with
moq_net::Error::Unauthorized. The broadcast stays open for whoever
holds it, unannounced.