+
+ /// Does a value of type `T` exist?
+ pub fn contains<T: 'static>(&self) -> bool {
+ self.data.contains_key(&TypeId::of::<T>())
+ }
+
+ /// Returns the number of items in the collection.
+ pub fn len(&self) -> uint {
+ self.data.len()
+ }
+
+ /// Returns true if there are no items in the collection.
+ pub fn is_empty(&self) -> bool {
+ self.data.is_empty()
+ }
+
+ /// Removes all items from the collection.
+ pub fn clear(&mut self) {
+ self.data.clear();
+ }