pub struct BehaviorRegistry { /* private fields */ }Expand description
Versioned, append-only registry of behaviour patterns. Cheap to clone
(Arc-wrapped). register keeps the highest-version pattern per id.
Implementations§
Source§impl BehaviorRegistry
impl BehaviorRegistry
Sourcepub fn register(&self, pattern: BehaviorPattern)
pub fn register(&self, pattern: BehaviorPattern)
Register a pattern, replacing an existing pattern with the same id when the new version is greater than or equal to the stored version.
Sourcepub fn extend<I: IntoIterator<Item = BehaviorPattern>>(&self, patterns: I)
pub fn extend<I: IntoIterator<Item = BehaviorPattern>>(&self, patterns: I)
Register every pattern from patterns.
Sourcepub fn snapshot(&self) -> Vec<BehaviorPattern>
pub fn snapshot(&self) -> Vec<BehaviorPattern>
Clone all registered patterns in registry order.
Trait Implementations§
Source§impl Clone for BehaviorRegistry
impl Clone for BehaviorRegistry
Source§fn clone(&self) -> BehaviorRegistry
fn clone(&self) -> BehaviorRegistry
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Default for BehaviorRegistry
impl Default for BehaviorRegistry
Source§fn default() -> BehaviorRegistry
fn default() -> BehaviorRegistry
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for BehaviorRegistry
impl !RefUnwindSafe for BehaviorRegistry
impl Send for BehaviorRegistry
impl Sync for BehaviorRegistry
impl Unpin for BehaviorRegistry
impl UnsafeUnpin for BehaviorRegistry
impl !UnwindSafe for BehaviorRegistry
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