X-Git-Url: https://git.chrismorgan.info/anymap/blobdiff_plain/6daea5338511debd17890e14082d6b8a4c00a368..6bf612e2eda6457762ce6a658b2d6f304ea09b19:/src/lib.rs diff --git a/src/lib.rs b/src/lib.rs index 1fae987..0c71e36 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -141,6 +141,11 @@ impl AnyMap { pub fn remove(&mut self) { self.data.remove(&TypeId::of::()); } + + /// Does a value of type `T` exist? + pub fn contains(&self) -> bool { + self.data.contains_key(&TypeId::of::()) + } } impl Collection for AnyMap {