Type Alias CommonModuleInitRegistry

Source
pub type CommonModuleInitRegistry = ModuleInitRegistry<DynCommonModuleInit>;

Aliased Type§

struct CommonModuleInitRegistry(BTreeMap<ModuleKind, DynCommonModuleInit>);

Fields§

§0: BTreeMap<ModuleKind, DynCommonModuleInit>

Implementations

Source§

impl<M> ModuleInitRegistry<M>

Source

pub fn iter(&self) -> impl Iterator<Item = (&ModuleKind, &M)>

Source§

impl<M> ModuleInitRegistry<M>

Source

pub fn new() -> Self

Source

pub fn attach<T>(&mut self, gen: T)
where T: Into<M> + 'static + Send + Sync, M: AsRef<dyn IDynCommonModuleInit + Send + Sync + 'static>,

Source

pub fn kinds(&self) -> BTreeSet<ModuleKind>

Source

pub fn get(&self, k: &ModuleKind) -> Option<&M>

Source§

impl<M> ModuleInitRegistry<M>
where M: AsRef<dyn IDynCommonModuleInit + Send + Sync + 'static>,

Source

pub fn decoders<'a>( &self, modules: impl Iterator<Item = (ModuleInstanceId, &'a ModuleKind)>, ) -> Result<ModuleDecoderRegistry>

👎Deprecated: You probably want available_decoders to support missing module kinds. If you really want a strict behavior, use decoders_strict
Source

pub fn decoders_strict<'a>( &self, modules: impl Iterator<Item = (ModuleInstanceId, &'a ModuleKind)>, ) -> Result<ModuleDecoderRegistry>

Get decoders for modules and fail if any is unsupported

Source

pub fn available_decoders<'a>( &self, modules: impl Iterator<Item = (ModuleInstanceId, &'a ModuleKind)>, ) -> Result<ModuleDecoderRegistry>

Get decoders for modules and skip unsupported ones

Trait Implementations

Source§

impl<M: Clone> Clone for ModuleInitRegistry<M>

Source§

fn clone(&self) -> ModuleInitRegistry<M>

Returns a copy of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl<M: Debug> Debug for ModuleInitRegistry<M>

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<M> Default for ModuleInitRegistry<M>

Source§

fn default() -> Self

Returns the “default value” for a type. Read more
Source§

impl<M> From<Vec<M>> for ModuleInitRegistry<M>
where M: AsRef<dyn IDynCommonModuleInit + Send + Sync + 'static>,

Source§

fn from(value: Vec<M>) -> Self

Converts to this type from the input type.
Source§

impl<M> FromIterator<M> for ModuleInitRegistry<M>
where M: AsRef<dyn IDynCommonModuleInit + Send + Sync + 'static>,

Source§

fn from_iter<T: IntoIterator<Item = M>>(iter: T) -> Self

Creates a value from an iterator. Read more