pub struct ModuleManager { /* private fields */ }
Expand description
Manages modules
Implementations§
Source§impl ModuleManager
impl ModuleManager
Sourcepub fn new() -> Arc<ModuleManager>
pub fn new() -> Arc<ModuleManager>
Creates new module manager, used in daemon for loading plugins and base modules
Sourcepub async fn add_module(&self, module: UniqueSDModule)
pub async fn add_module(&self, module: UniqueSDModule)
Adds a new module to be used with core
Sourcepub async fn get_module(&self, name: &str) -> Option<UniqueSDModule>
pub async fn get_module(&self, name: &str) -> Option<UniqueSDModule>
Attempts to get module with specified name
Sourcepub async fn get_modules(&self) -> HashMap<String, UniqueSDModule>
pub async fn get_modules(&self) -> HashMap<String, UniqueSDModule>
Returns all modules in map format
Sourcepub async fn get_module_list(&self) -> Vec<UniqueSDModule> ⓘ
pub async fn get_module_list(&self) -> Vec<UniqueSDModule> ⓘ
Returns all modules in vector format
Sourcepub async fn get_modules_from_list(
&self,
list: &[String],
) -> Vec<UniqueSDModule> ⓘ
pub async fn get_modules_from_list( &self, list: &[String], ) -> Vec<UniqueSDModule> ⓘ
Returns modules from names provided if they exist
Sourcepub async fn get_modules_for_component(
&self,
component: &str,
) -> Vec<UniqueSDModule> ⓘ
pub async fn get_modules_for_component( &self, component: &str, ) -> Vec<UniqueSDModule> ⓘ
Retrieves modules that are listening to a specified component
Sourcepub async fn get_modules_for_declared_components(
&self,
components: &[String],
) -> Vec<UniqueSDModule> ⓘ
pub async fn get_modules_for_declared_components( &self, components: &[String], ) -> Vec<UniqueSDModule> ⓘ
Retrieves modules that have added specified components
Sourcepub async fn get_modules_for_components(
&self,
components: &[String],
) -> Vec<UniqueSDModule> ⓘ
pub async fn get_modules_for_components( &self, components: &[String], ) -> Vec<UniqueSDModule> ⓘ
Retrieves modules that are listening to specified components
Sourcepub async fn get_components_of_module(
&self,
module_name: &str,
) -> Option<HashMap<String, ComponentDefinition>>
pub async fn get_components_of_module( &self, module_name: &str, ) -> Option<HashMap<String, ComponentDefinition>>
Retrieves components that module defined
Sourcepub async fn get_components(
&self,
) -> HashMap<String, (ComponentDefinition, UniqueSDModule)>
pub async fn get_components( &self, ) -> HashMap<String, (ComponentDefinition, UniqueSDModule)>
Retrieves all components that all modules define
Sourcepub async fn get_module_component_map(
&self,
) -> HashMap<String, HashMap<String, ComponentDefinition>>
pub async fn get_module_component_map( &self, ) -> HashMap<String, HashMap<String, ComponentDefinition>>
Retrieves all components that all modules define, but in module to component map format
Sourcepub async fn get_rendering_module_map(
&self,
) -> HashMap<String, HashMap<String, UniqueSDModule>>
pub async fn get_rendering_module_map( &self, ) -> HashMap<String, HashMap<String, UniqueSDModule>>
Retrieves all modules that can render things
Sourcepub async fn get_modules_for_rendering(
&self,
names: &Vec<String>,
) -> HashMap<String, UniqueSDModule>
pub async fn get_modules_for_rendering( &self, names: &Vec<String>, ) -> HashMap<String, UniqueSDModule>
Retrieves all modules that should be able to render according to list of component names
Sourcepub async fn get_component(
&self,
component_name: &str,
) -> Option<(ComponentDefinition, UniqueSDModule)>
pub async fn get_component( &self, component_name: &str, ) -> Option<(ComponentDefinition, UniqueSDModule)>
Retrieves component if it exists
Sourcepub async fn read_module_map(
&self,
) -> RwLockReadGuard<'_, HashMap<String, UniqueSDModule>>
pub async fn read_module_map( &self, ) -> RwLockReadGuard<'_, HashMap<String, UniqueSDModule>>
Returns module map read lock
Sourcepub async fn read_component_map(
&self,
) -> RwLockReadGuard<'_, HashMap<String, (ComponentDefinition, UniqueSDModule)>>
pub async fn read_component_map( &self, ) -> RwLockReadGuard<'_, HashMap<String, (ComponentDefinition, UniqueSDModule)>>
Returns component map read lock
Sourcepub async fn read_module_component_map(
&self,
) -> RwLockReadGuard<'_, HashMap<String, HashMap<String, ComponentDefinition>>>
pub async fn read_module_component_map( &self, ) -> RwLockReadGuard<'_, HashMap<String, HashMap<String, ComponentDefinition>>>
Returns module component map read lock
Sourcepub async fn read_component_listener_map(
&self,
) -> RwLockReadGuard<'_, HashMap<String, Vec<UniqueSDModule>>>
pub async fn read_component_listener_map( &self, ) -> RwLockReadGuard<'_, HashMap<String, Vec<UniqueSDModule>>>
Returns component listener map read lock
Sourcepub async fn read_rendering_modules_map(
&self,
) -> RwLockReadGuard<'_, HashMap<String, HashMap<String, UniqueSDModule>>>
pub async fn read_rendering_modules_map( &self, ) -> RwLockReadGuard<'_, HashMap<String, HashMap<String, UniqueSDModule>>>
Returns rendering modules map read lock
Sourcepub async fn send_global_event_to_modules(&self, event: SDGlobalEvent)
pub async fn send_global_event_to_modules(&self, event: SDGlobalEvent)
Sends global event to all modules, spawns a separate thread to do it, so doesn’t block current thread
Trait Implementations§
Source§impl Default for ModuleManager
impl Default for ModuleManager
Source§fn default() -> ModuleManager
fn default() -> ModuleManager
Auto Trait Implementations§
impl !Freeze for ModuleManager
impl !RefUnwindSafe for ModuleManager
impl Send for ModuleManager
impl Sync for ModuleManager
impl Unpin for ModuleManager
impl !UnwindSafe for ModuleManager
Blanket Implementations§
Source§impl<S, D, Swp, Dwp, T> AdaptInto<D, Swp, Dwp, T> for S
impl<S, D, Swp, Dwp, T> AdaptInto<D, Swp, Dwp, T> for S
Source§fn adapt_into_using<M>(self, method: M) -> Dwhere
M: TransformMatrix<Swp, Dwp, T>,
fn adapt_into_using<M>(self, method: M) -> Dwhere
M: TransformMatrix<Swp, Dwp, T>,
Source§fn adapt_into(self) -> D
fn adapt_into(self) -> D
Source§impl<Src, Scheme> ApproxFrom<Src, Scheme> for Srcwhere
Scheme: ApproxScheme,
impl<Src, Scheme> ApproxFrom<Src, Scheme> for Srcwhere
Scheme: ApproxScheme,
Source§fn approx_from(src: Src) -> Result<Src, <Src as ApproxFrom<Src, Scheme>>::Err>
fn approx_from(src: Src) -> Result<Src, <Src as ApproxFrom<Src, Scheme>>::Err>
Source§impl<Dst, Src, Scheme> ApproxInto<Dst, Scheme> for Srcwhere
Dst: ApproxFrom<Src, Scheme>,
Scheme: ApproxScheme,
impl<Dst, Src, Scheme> ApproxInto<Dst, Scheme> for Srcwhere
Dst: ApproxFrom<Src, Scheme>,
Scheme: ApproxScheme,
Source§type Err = <Dst as ApproxFrom<Src, Scheme>>::Err
type Err = <Dst as ApproxFrom<Src, Scheme>>::Err
Source§fn approx_into(self) -> Result<Dst, <Src as ApproxInto<Dst, Scheme>>::Err>
fn approx_into(self) -> Result<Dst, <Src as ApproxInto<Dst, Scheme>>::Err>
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
Source§impl<T, Dst> ConvAsUtil<Dst> for T
impl<T, Dst> ConvAsUtil<Dst> for T
Source§impl<T> ConvUtil for T
impl<T> ConvUtil for T
Source§fn approx_as<Dst>(self) -> Result<Dst, Self::Err>where
Self: Sized + ApproxInto<Dst>,
fn approx_as<Dst>(self) -> Result<Dst, Self::Err>where
Self: Sized + ApproxInto<Dst>,
Source§fn approx_as_by<Dst, Scheme>(self) -> Result<Dst, Self::Err>
fn approx_as_by<Dst, Scheme>(self) -> Result<Dst, Self::Err>
Source§impl<T, U> IntoColor<U> for Twhere
U: FromColor<T>,
impl<T, U> IntoColor<U> for Twhere
U: FromColor<T>,
Source§fn into_color(self) -> U
fn into_color(self) -> U
Source§impl<T, U> IntoColorUnclamped<U> for Twhere
U: FromColorUnclamped<T>,
impl<T, U> IntoColorUnclamped<U> for Twhere
U: FromColorUnclamped<T>,
Source§fn into_color_unclamped(self) -> U
fn into_color_unclamped(self) -> U
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§impl<T> Pointable for T
impl<T> Pointable for T
Source§impl<R, P> ReadPrimitive<R> for P
impl<R, P> ReadPrimitive<R> for P
Source§fn read_from_little_endian(read: &mut R) -> Result<Self, Error>
fn read_from_little_endian(read: &mut R) -> Result<Self, Error>
ReadEndian::read_from_little_endian()
.Source§impl<T, U> TryIntoColor<U> for Twhere
U: TryFromColor<T>,
impl<T, U> TryIntoColor<U> for Twhere
U: TryFromColor<T>,
Source§fn try_into_color(self) -> Result<U, OutOfBounds<U>>
fn try_into_color(self) -> Result<U, OutOfBounds<U>>
OutOfBounds
error is returned which contains
the unclamped color. Read more