Skip to main content

Follower

Struct Follower 

Source
pub struct Follower<T: Followed = Export<Consumer<()>>> { /* private fields */ }
Expand description

Carries an Export, or a Release of a passthrough track, across its broadcast’s returns, following the publisher identities serving its path through Following.

The same stream (the same identity) returning within the follow continues the export. Another identity taking the path fails with Error::Replaced, unless stitching, which switches the program to it at once. Subscriptions are sticky, so without stitching a replaced publisher that stays up keeps the export until it ends.

A track failure is followed only when its cause says the publisher left: the source failed to deliver, as [moq_net::Error::retry] answers (a lost route, an ended session, a cancel, or a going away), or a moq-transport peer ended it with a code it does not register, since PUBLISH_DONE has none for a lost route. Any other failure is the export’s own and fails here at once.

An identity that comes back is awaited until its catalog serves a first snapshot, with no deadline but its own end. A return that refuses its catalog waits for the next change, and the follow running out reports that refusal. A refusal to resolve the path at all fails at once, as it does for every Following reader.

Implementations§

Source§

impl<T: Followed> Follower<T>

Source

pub fn new(export: T) -> Result<Self>

Follow the path export reads, from the broadcast it resolved.

Fails when the export’s origin can never cover its path.

Source

pub fn with_follow(self, follow: Duration) -> Self

Wait up to follow after the broadcast ends for the same identity, or with stitching a replacement, to come back. Defaults to Duration::ZERO, which carries on only into an identity already serving the path.

Source

pub fn with_stitch(self, stitch: bool) -> Self

Follow another publisher identity taking the path, as a full program switch (see Export::follow). Defaults to false.

Source

pub fn export(&self) -> &T

The export being carried on.

Source

pub fn poll_next(&mut self, waiter: &Waiter) -> Poll<Result<Option<Frame>>>

Get the next muxed frame, or None once the broadcast ends with nothing to follow.

Source

pub async fn next(&mut self) -> Result<Option<Frame>>

Get the next muxed frame, or None once the broadcast ends with nothing to follow.

Awaits poll_next.

Auto Trait Implementations§

§

impl<T = Export<Consumer>> !Freeze for Follower<T>

§

impl<T = Export<Consumer>> !RefUnwindSafe for Follower<T>

§

impl<T = Export<Consumer>> !Sync for Follower<T>

§

impl<T = Export<Consumer>> !UnwindSafe for Follower<T>

§

impl<T> Send for Follower<T>
where T: Send,

§

impl<T> Unpin for Follower<T>
where T: Unpin,

§

impl<T> UnsafeUnpin for Follower<T>
where T: UnsafeUnpin,

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> 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, 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