pub struct MountRegistry { /* private fields */ }Expand description
Shared mount registry accessible by all protocol servers.
Implementations§
Source§impl MountRegistry
impl MountRegistry
pub fn new(max_mounts: usize) -> Self
Sourcepub fn attach_global(&mut self, registry: Arc<MetricsRegistry>)
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.
pub fn is_empty(&self) -> bool
Sourcepub fn cancel_all(&self)
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.
Sourcepub fn register(
&self,
path: Arc<str>,
config: MountConfig,
) -> Result<MountHandle>
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.
Sourcepub fn register_with(
&self,
path: Arc<str>,
config: MountConfig,
options: MountOptions,
) -> Result<MountHandle>
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.
Sourcepub fn get_handle(&self, path: &str) -> Option<MountHandle>
pub fn get_handle(&self, path: &str) -> Option<MountHandle>
Get a mount handle by path.
Sourcepub fn unregister(&self, path: &str) -> Option<MountHandle>
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.
Sourcepub fn snapshots(&self) -> Vec<(MountId, MountSnapshot)>
pub fn snapshots(&self) -> Vec<(MountId, MountSnapshot)>
Snapshot all registered mounts (identity + stats).