From cec53b883696692aab5db70045be143ff0be01ea Mon Sep 17 00:00:00 2001 From: Kostya Shishkov Date: Fri, 12 Jun 2020 16:14:15 +0200 Subject: [PATCH] core: add iterator for the lists of registered demuxers and muxers --- nihav-core/src/demuxers/mod.rs | 4 ++++ nihav-core/src/muxers/mod.rs | 4 ++++ 2 files changed, 8 insertions(+) diff --git a/nihav-core/src/demuxers/mod.rs b/nihav-core/src/demuxers/mod.rs index 6723cf2..9a69abb 100644 --- a/nihav-core/src/demuxers/mod.rs +++ b/nihav-core/src/demuxers/mod.rs @@ -459,4 +459,8 @@ impl RegisteredDemuxers { } None } + /// Provides an iterator over currently registered demuxers. + pub fn iter(&self) -> std::slice::Iter<&DemuxerCreator> { + self.dmxs.iter() + } } diff --git a/nihav-core/src/muxers/mod.rs b/nihav-core/src/muxers/mod.rs index 49f4e2d..6194f51 100644 --- a/nihav-core/src/muxers/mod.rs +++ b/nihav-core/src/muxers/mod.rs @@ -164,4 +164,8 @@ impl RegisteredMuxers { } None } + /// Provides an iterator over currently registered muxers. + pub fn iter(&self) -> std::slice::Iter<&MuxerCreator> { + self.muxes.iter() + } } -- 2.39.5