pub struct MediaSourceRegistry { /* private fields */ }Expand description
Runtime-mutable registry of AsyncMediaSources.
Implementations§
Source§impl MediaSourceRegistry
impl MediaSourceRegistry
Sourcepub fn register(&mut self, source: Arc<dyn AsyncMediaSource>)
pub fn register(&mut self, source: Arc<dyn AsyncMediaSource>)
Register a producer. Idempotent per source_id: a re-register (reload)
replaces rather than accumulating a duplicate — otherwise every
:plugin-reload would double the images in a buffer.
Sourcepub fn unregister(&mut self, source_id: u64) -> usize
pub fn unregister(&mut self, source_id: u64) -> usize
Unregister every producer for source_id; returns the count removed.
No-op when absent, per the teardown contract.
Sourcepub fn sources(&self) -> Vec<Arc<dyn AsyncMediaSource>>
pub fn sources(&self) -> Vec<Arc<dyn AsyncMediaSource>>
A wait-free snapshot of the registered producers.
Trait Implementations§
Source§impl Clone for MediaSourceRegistry
impl Clone for MediaSourceRegistry
Source§fn clone(&self) -> MediaSourceRegistry
fn clone(&self) -> MediaSourceRegistry
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for MediaSourceRegistry
impl Debug for MediaSourceRegistry
Source§impl Default for MediaSourceRegistry
impl Default for MediaSourceRegistry
Source§fn default() -> MediaSourceRegistry
fn default() -> MediaSourceRegistry
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl !RefUnwindSafe for MediaSourceRegistry
impl !UnwindSafe for MediaSourceRegistry
impl Freeze for MediaSourceRegistry
impl Send for MediaSourceRegistry
impl Sync for MediaSourceRegistry
impl Unpin for MediaSourceRegistry
impl UnsafeUnpin for MediaSourceRegistry
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more