Skip to main content

Requests

Struct Requests 

Source
pub struct Requests { /* private fields */ }
Expand description

Serves the groups a track’s readers miss, the group-level analogue of broadcast::Requests.

Most tracks never serve old content, so this capability lives on a dedicated handle rather than Producer: a relay creates one (via Producer::requests or Request::requests) to pull past groups from upstream. While at least one is alive a reader’s miss queues a FillGroups for it to serve; with none, the miss is named dropped, and a cache-miss Consumer::fetch_group on an accepted track fails fast with Error::NotFound. Keep taking fills until it drops: a reader waits on its fill until it is answered or dropped, so a handle left alive but unread stalls that reader.

On the track’s own publisher a fetch (Consumer::fetch_group, or a peer’s bounded read of named groups) also asks for groups past the newest one produced. A handler that may still produce such a group, as a store still recording does, leaves it unanswered while keeping the fill: the live feed delivering it answers the fill. FillGroups::drop_groups says it never will be.

A live handle also lets a reader at a frame a group copy shed replay it: a FillGroups of that one group from that frame asks for a flight, a copy of its own paced by the readers riding it, which they leave for the copy ahead once it holds their frame within reach. Serve it like any group, and stop once nobody reads it: see FillGroups::is_wanted.

Implementations§

Source§

impl Requests

Source

pub fn name(&self) -> &str

The track’s name, unique within its broadcast.

Source

pub fn poll_requested_fill(&self, waiter: &Waiter) -> Poll<Result<FillGroups>>

The next run of groups readers miss, to serve via FillGroups::accept and FillGroups::drop_groups, including the group containing a reader’s time start that no group the cache holds places (see FillGroups::floor), and a fetch’s groups past the newest one produced (see Requests).

A relay fetches the run upstream; an origin serves the groups its cache evicted from its own store, as moq-archive does. Errors once the track is aborted.

Source

pub async fn requested_fill(&self) -> Result<FillGroups>

The next run of groups readers miss, to serve via FillGroups::accept and FillGroups::drop_groups, including the group containing a reader’s time start that no group the cache holds places (see FillGroups::floor), and a fetch’s groups past the newest one produced (see Requests).

A relay fetches the run upstream; an origin serves the groups its cache evicted from its own store, as moq-archive does. Errors once the track is aborted.

Awaits poll_requested_fill.

Source

pub fn demand(&self) -> Demand

Watch subscriber demand without keeping the track alive.

Trait Implementations§

Source§

impl Clone for Requests

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 Drop for Requests

Source§

fn drop(&mut self)

Executes the destructor for this type. Read more
Source§

fn pin_drop(self: Pin<&mut Self>)

🔬This is a nightly-only experimental API. (pin_ergonomics)
Execute the destructor for this type, but different to Drop::drop, it requires self to be pinned. Read more

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