A dynamically allocated storage system. Check it out on Github, or its capabilities on the
tests. This is meant to serve as a storage solution for resources in a dynamic context. It
supports runtime borrow checking using RefCell
s. It will support a concurrent context in
the future.
let mut storage = DynamicStorage::new();
storage.allocate_for::<usize>();
storage.allocate_for::<String>();
storage.insert::<String>("abc".into());
storage.insert_many::<usize>(vec![2usize, 4, 8, 16, 32]);
let mut my_string = storage.get_mut::<String>();
for i in 0..5 {
*my_string = format!("{:?}, {:?}", *my_string, *storage.ind::<usize>(i));
}
assert_eq!("abc, 2, 4, 8, 16, 32".to_string(), &*my_string);
ErrorDesc | The basic error descriptions for why a dynamically typed resource operation didn't work. It does
not contain however, the description for unit-related errors which handled with a UnitError by
using the Unit variant of ErrorDesc .
|
UnitError | |