diff options
Diffstat (limited to 'plugins/warp/src/cache')
| -rw-r--r-- | plugins/warp/src/cache/container.rs | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/plugins/warp/src/cache/container.rs b/plugins/warp/src/cache/container.rs index 0b478ed1..99746d9a 100644 --- a/plugins/warp/src/cache/container.rs +++ b/plugins/warp/src/cache/container.rs @@ -35,3 +35,8 @@ pub fn cached_containers() -> Vec<Arc<RwLock<Box<dyn Container>>>> { let containers_cache = CONTAINER_CACHE.get_or_init(Default::default); containers_cache.iter().map(|c| c.clone()).collect() } + +pub fn cached_container_by_name(name: &str) -> Option<Arc<RwLock<Box<dyn Container>>>> { + let containers_cache = CONTAINER_CACHE.get_or_init(Default::default); + containers_cache.get(name).map(|c| c.clone()) +} |
