From: Kostya Shishkov Date: Fri, 12 Jun 2020 14:14:15 +0000 (+0200) Subject: core: add iterator for the lists of registered demuxers and muxers X-Git-Url: https://git.nihav.org/?a=commitdiff_plain;h=cec53b883696692aab5db70045be143ff0be01ea;p=nihav.git core: add iterator for the lists of registered demuxers and muxers --- 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() + } }