+
+ /// Does a value of type `T` exist?
+ pub fn contains<T: 'static>(&self) -> bool {
+ self.data.contains_key(&TypeId::of::<T>())
+ }
+}
+
+impl Collection for AnyMap {
+ fn len(&self) -> uint {
+ self.data.len()
+ }
+
+ fn is_empty(&self) -> bool {
+ self.data.is_empty()
+ }
+}
+
+impl Mutable for AnyMap {
+ fn clear(&mut self) {
+ self.data.clear();
+ }