Type Alias ServerModuleInitRegistry

Source
pub type ServerModuleInitRegistry = ModuleInitRegistry<DynServerModuleInit>;

Aliased Type§

struct ServerModuleInitRegistry(/* private fields */);

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() -> ModuleInitRegistry<M>

Source

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

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>,

Source

pub fn decoders<'a>( &self, modules: impl Iterator<Item = (u16, &'a ModuleKind)>, ) -> Result<ModuleRegistry<Decoder, DecodingMode>, Error>

👎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 = (u16, &'a ModuleKind)>, ) -> Result<ModuleRegistry<Decoder, DecodingMode>, Error>

Get decoders for modules and fail if any is unsupported

Source

pub fn available_decoders<'a>( &self, modules: impl Iterator<Item = (u16, &'a ModuleKind)>, ) -> Result<ModuleRegistry<Decoder, DecodingMode>, Error>

Get decoders for modules and skip unsupported ones

Trait Implementations§

Source§

impl ServerModuleInitRegistryExt for ServerModuleInitRegistry

Source§

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

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 for ModuleInitRegistry<M>
where M: Debug,

Source§

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

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

impl<M> Default for ModuleInitRegistry<M>

Source§

fn default() -> ModuleInitRegistry<M>

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>,

Source§

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

Converts to this type from the input type.
Source§

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

Source§

fn from_iter<T>(iter: T) -> ModuleInitRegistry<M>
where T: IntoIterator<Item = M>,

Creates a value from an iterator. Read more