pub trait Services:
Sized
+ Send
+ Sync {
// Required methods
fn has<S>(&self) -> bool
where S: ?Sized + 'static;
fn get<S>(&self) -> Option<Arc<S>>
where S: ?Sized + Send + Sync + 'static;
fn put<S, R>(&mut self, resolver: R)
where S: ?Sized + Send + Sync + 'static,
R: Resolve<S, Self> + 'static;
// Provided method
fn replace<S, F>(&mut self, f: F)
where S: Send + Sync + 'static,
F: FnOnce(Option<&S>) -> S { ... }
}Required Methods§
Sourcefn has<S>(&self) -> boolwhere
S: ?Sized + 'static,
fn has<S>(&self) -> boolwhere
S: ?Sized + 'static,
Returns whether the service container has the specified service or not.
Provided Methods§
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.