pub struct Registry { /* private fields */ }
Expand description
Specifies an entity responsible for providing actors and keeping track of their usage.
Implementations§
source§impl Registry
impl Registry
sourcepub fn new(fleet: &Fleet, random: Arc<dyn Random + Send + Sync>) -> Self
pub fn new(fleet: &Fleet, random: Arc<dyn Random + Send + Sync>) -> Self
Creates a new instance of Registry
sourcepub fn use_actor(&mut self, actor: &Arc<Actor>) -> bool
pub fn use_actor(&mut self, actor: &Arc<Actor>) -> bool
Removes an actor from the list of available actors. Returns whether the actor was present in the registry.
sourcepub fn free_actor(&mut self, actor: &Arc<Actor>) -> bool
pub fn free_actor(&mut self, actor: &Arc<Actor>) -> bool
Adds actor to the list of available actors. Returns whether the actor was not present in the registry.
sourcepub fn available(&self) -> impl Iterator<Item = Arc<Actor>> + '_
pub fn available(&self) -> impl Iterator<Item = Arc<Actor>> + '_
Returns list of all available actors.
sourcepub fn next(&self) -> impl Iterator<Item = Arc<Actor>> + '_
pub fn next(&self) -> impl Iterator<Item = Arc<Actor>> + '_
Returns next available actors from each different type.
sourcepub fn deep_slice(&self, filter: impl Fn(&Actor) -> bool) -> Self
pub fn deep_slice(&self, filter: impl Fn(&Actor) -> bool) -> Self
Creates a deep sliced copy of registry keeping only specific actors.
Auto Trait Implementations§
impl !RefUnwindSafe for Registry
impl Send for Registry
impl Sync for Registry
impl Unpin for Registry
impl !UnwindSafe for Registry
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