Skip to main content

FeedHandle

Struct FeedHandle 

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

Handle to a running feed.

Provides per-feed monitoring and control: health events, metrics, queue telemetry, uptime, pause/resume, and stop.

Backed by Arc<FeedSharedState> — cloning is cheap (Arc bump). Metrics are read from the same atomic counters that the feed worker thread writes.

Implementations§

Source§

impl FeedHandle

Source

pub fn id(&self) -> FeedId

The feed’s unique identifier.

Source

pub fn is_paused(&self) -> bool

Whether the feed is currently paused.

Source

pub fn is_alive(&self) -> bool

Whether the worker thread is still alive.

Source

pub fn metrics(&self) -> FeedMetrics

Get a snapshot of the feed’s current metrics.

Reads live atomic counters maintained by the feed worker thread.

Source

pub fn queue_telemetry(&self) -> QueueTelemetry

Get a snapshot of the feed’s source and sink queue depths/capacities.

Source queue depth reads the frame queue’s internal lock briefly. Sink queue depth reads an atomic counter with no locking.

If no processing session is active (between restarts or after shutdown), both depths return 0.

Source

pub fn uptime(&self) -> Duration

Elapsed time since the feed’s current processing session started.

Semantics: session-scoped uptime. The clock resets on each successful start or restart. If the feed has not started yet or is between restart attempts, the value reflects the time since the last session began.

Useful for monitoring feed stability: a feed that restarts frequently will show low uptime values.

Source

pub fn decode_status(&self) -> Option<DecodeStatus>

The decode method confirmed by the media backend for this feed.

Returns None if no decode decision has been made yet (the stream has not started, the backend has not negotiated a decoder, or the feed is between restarts).

Source

pub fn diagnostics(&self) -> FeedDiagnostics

Get a consolidated diagnostics snapshot of this feed.

Composes lifecycle state, metrics, queue depths, decode status, and view-system health into a single read. All data comes from the same atomic counters the individual accessors use — this is a convenience composite, not a new data source.

Suitable for periodic polling (1–5 s) by dashboards and health probes.

Source

pub fn pause(&self) -> Result<(), NvError>

Pause the feed (stop pulling frames from source; stages idle).

Uses a condvar to wake the worker without spin-sleeping.

§Errors

Returns an error if the feed is already paused.

Source

pub fn resume(&self) -> Result<(), NvError>

Resume a paused feed.

Notifies the worker thread via condvar so it wakes immediately.

§Errors

Returns an error if the feed is not paused.

Trait Implementations§

Source§

impl Clone for FeedHandle

Source§

fn clone(&self) -> FeedHandle

Returns a duplicate of the value. Read more
1.0.0 · Source§

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

Performs copy-assignment from source. 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> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self>

Converts self into a Left variant of Either<Self, Self> if into_left is true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

Converts self into a Left variant of Either<Self, Self> if into_left(&self) returns true. Converts self into a Right variant of Either<Self, Self> otherwise. 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 = Infallible

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

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

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