pub struct ApplicationObjectRegistry { /* private fields */ }
Expand description
Registry for managing application objects
Implementations§
Source§impl ApplicationObjectRegistry
impl ApplicationObjectRegistry
pub fn new() -> Self
Sourcepub fn register(&mut self, object: Box<dyn ApplicationObject>) -> SharedObjectId
pub fn register(&mut self, object: Box<dyn ApplicationObject>) -> SharedObjectId
Register a new application object
Sourcepub fn get(&self, id: &SharedObjectId) -> Option<&dyn ApplicationObject>
pub fn get(&self, id: &SharedObjectId) -> Option<&dyn ApplicationObject>
Get an object by ID
Sourcepub fn get_by_type(&self, type_name: &str) -> Vec<Box<dyn ApplicationObject>>
pub fn get_by_type(&self, type_name: &str) -> Vec<Box<dyn ApplicationObject>>
Get all objects of a specific type (returning owned clones for safety)
Sourcepub fn remove(
&mut self,
id: &SharedObjectId,
) -> Option<Box<dyn ApplicationObject>>
pub fn remove( &mut self, id: &SharedObjectId, ) -> Option<Box<dyn ApplicationObject>>
Remove an object
Sourcepub fn ids(&self) -> Vec<SharedObjectId>
pub fn ids(&self) -> Vec<SharedObjectId>
Get all object IDs
Sourcepub async fn process_message(
&mut self,
message: SharedMessage,
) -> Result<Vec<SharedObjectId>>
pub async fn process_message( &mut self, message: SharedMessage, ) -> Result<Vec<SharedObjectId>>
Process a message against all appropriate objects
Trait Implementations§
Source§impl Debug for ApplicationObjectRegistry
impl Debug for ApplicationObjectRegistry
Auto Trait Implementations§
impl Freeze for ApplicationObjectRegistry
impl !RefUnwindSafe for ApplicationObjectRegistry
impl Send for ApplicationObjectRegistry
impl Sync for ApplicationObjectRegistry
impl Unpin for ApplicationObjectRegistry
impl !UnwindSafe for ApplicationObjectRegistry
Blanket Implementations§
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
Mutably borrows from an owned value. Read more