flatten_objects
FlattenObjects
is a container that stores numbered objects.
Objects can be added to the FlattenObjects
, a unique ID will be assigned
to the object. The ID can be used to retrieve the object later.
Example
use FlattenObjects;
let mut objects = new;
// Add `23` 10 times and assign them IDs from 0 to 9.
for i in 0..=9
// Remove the object with ID 6.
assert_eq!;
assert!;
// Add `42` (the ID 6 is available now).
let id = objects.add.unwrap;
assert_eq!;
assert!;
assert_eq!;
assert_eq!;
assert!;