convert Client into Service
Signed-off-by: Jason Volk <jason@zemos.net>
This commit is contained in:
parent
f465d77ad3
commit
8a2ae401df
13 changed files with 159 additions and 23 deletions
|
@ -43,6 +43,12 @@ pub(crate) struct Args<'a> {
|
|||
pub(crate) type Map = BTreeMap<String, MapVal>;
|
||||
pub(crate) type MapVal = (Arc<dyn Service>, Arc<dyn Any + Send + Sync>);
|
||||
|
||||
impl Args<'_> {
|
||||
pub(crate) fn get_service<T: Any + Send + Sync>(&self, name: &str) -> Option<Arc<T>> {
|
||||
get::<T>(self.service, name)
|
||||
}
|
||||
}
|
||||
|
||||
pub(crate) fn get<T: Any + Send + Sync>(map: &Map, name: &str) -> Option<Arc<T>> {
|
||||
map.get(name).map(|(_, s)| {
|
||||
s.clone()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue