Skip to main content

MountRegistry

Struct MountRegistry 

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

Shared mount registry accessible by all protocol servers.

Implementations§

Source§

impl MountRegistry

Source

pub fn new(max_mounts: usize) -> Self

Source

pub fn attach_global(&mut self, registry: Arc<MetricsRegistry>)

Mirror per-mount frame counters into a global metrics registry. Must be called before mounts are registered.

Source

pub fn len(&self) -> usize

Number of currently registered mounts.

Source

pub fn is_empty(&self) -> bool

Source

pub fn cancel_all(&self)

Cancel every mount’s data plane and drop the registry entries. Protocol servers call this on shutdown; the mount handles held by callers become detached but their broadcast receivers close when those handles are dropped.

Source

pub fn paths(&self) -> Vec<MountId>

List all registered mounts in stable path order.

Source

pub fn register( &self, path: Arc<str>, config: MountConfig, ) -> Result<MountHandle>

Register a new mount from a config with default options. Returns a handle on success.

Source

pub fn register_with( &self, path: Arc<str>, config: MountConfig, options: MountOptions, ) -> Result<MountHandle>

Register a new mount from a config plus per-mount tuning options (queue capacity, event sink, startup cache policy). Returns a handle on success.

This is the single construction path for Mount: protocol servers (RTSP via register_mount, RTMP, SRT) and the multi-protocol gateway all funnel through it, so every mount gets identical wiring for stats, startup cache and lifecycle.

Source

pub fn get_handle(&self, path: &str) -> Option<MountHandle>

Get a mount handle by path.

Source

pub fn unregister(&self, path: &str) -> Option<MountHandle>

Remove a mount from the registry and cancel its data plane.

Protocol servers (RTMP/SRT) must call this when the publishing session that created the mount ends, otherwise every distinct stream path permanently consumes one of the max_mounts slots.

Source

pub fn snapshots(&self) -> Vec<(MountId, MountSnapshot)>

Snapshot all registered mounts (identity + stats).

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> 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> Same for T

Source§

type Output = T

Should always be Self
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