pub struct Backends { /* private fields */ }Expand description
Container of engine backends — concrete impls of abstract traits.
API mirrors the legacy ServiceRegistry (drop-in replacement).
Implementations§
Source§impl Backends
impl Backends
Sourcepub fn with_parent(parent: Arc<Backends>) -> Self
pub fn with_parent(parent: Arc<Backends>) -> Self
Creates a container that delegates lookups to parent when a key
is absent locally.
Sourcepub fn insert<T: Send + Sync + 'static>(&mut self, backend: T)
pub fn insert<T: Send + Sync + 'static>(&mut self, backend: T)
Inserts a backend, keyed by T’s TypeId. Convention: T is
the trait-object type (e.g. Arc<Mutex<Box<dyn PhysicsProvider>>>).
Sourcepub fn get<T: Send + Sync + 'static>(&self) -> Option<&T>
pub fn get<T: Send + Sync + 'static>(&self) -> Option<&T>
Returns a borrow of the registered backend, walking the parent chain.
Sourcepub fn require<T: Send + Sync + 'static>(&self) -> &T
pub fn require<T: Send + Sync + 'static>(&self) -> &T
Returns a borrow of the registered backend, panicking if absent. Use for backends mandatory at engine startup.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Backends
impl !RefUnwindSafe for Backends
impl Send for Backends
impl Sync for Backends
impl Unpin for Backends
impl UnsafeUnpin for Backends
impl !UnwindSafe for Backends
Blanket Implementations§
Source§impl<T> AppLifecycle for Twhere
T: ?Sized,
impl<T> AppLifecycle for Twhere
T: ?Sized,
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