Struct SystemManager

Source
pub struct SystemManager { /* private fields */ }
Expand description

A system manager that coordinates multiple systems

Implementations§

Source§

impl SystemManager

Source

pub fn new() -> Self

Create a new system manager

Source

pub fn with_capacity(expected_objects: usize) -> Self

Create a new system manager with expected capacity

Source

pub fn add_system(&mut self, system: Box<dyn System>)

Add a system to the manager

Source

pub fn remove_system(&mut self, name: &str) -> Option<Box<dyn System>>

Remove a system from the manager

Source

pub fn get_system(&self, name: &str) -> Option<&Box<dyn System>>

Get a system by name

Source

pub fn systems(&self) -> &HashMap<String, Box<dyn System>>

Get all systems

Source

pub fn system_count(&self) -> usize

Get system count

Source

pub async fn register_object(&self, object: Object)

Register an object with the manager

Source

pub async fn get_object(&self, id: &str) -> Option<Object>

Get an object by ID

Source

pub async fn get_all_objects(&self) -> Vec<Object>

Get all objects

Source

pub async fn object_count(&self) -> usize

Get object count

Source

pub async fn clear_objects(&self)

Clear all objects

Source

pub async fn reserve_objects(&self, additional: usize)

Reserve capacity for objects

Source

pub async fn process_all( &mut self, priority: Priority, ) -> Result<Vec<ActionResult>>

Process all objects through all systems

Source

pub async fn process_with_system( &mut self, system_name: &str, objects: Vec<Object>, priority: Priority, ) -> Result<Vec<ActionResult>>

Process objects through a specific system

Source

pub async fn initialize_all(&mut self) -> Result<()>

Initialize all systems

Source

pub async fn shutdown_all(&mut self) -> Result<()>

Shutdown all systems

Source

pub fn get_all_stats(&self) -> HashMap<String, SystemStats>

Get statistics for all systems

Trait Implementations§

Source§

impl Default for SystemManager

Source§

fn default() -> Self

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

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.