pub struct ItemRegistry { /* private fields */ }Expand description
Item registry — owns all registered items, validates prereq graph.
Implementations§
Source§impl ItemRegistry
impl ItemRegistry
pub fn new() -> Self
Sourcepub fn register(&mut self, items: Vec<Item>) -> Result<(), AriaError>
pub fn register(&mut self, items: Vec<Item>) -> Result<(), AriaError>
Register items. Returns Err if a cyclic prerequisite is detected.
Sourcepub fn eligible<'a>(&'a self, resolved_set: &HashSet<String>) -> Vec<&'a Item>
pub fn eligible<'a>(&'a self, resolved_set: &HashSet<String>) -> Vec<&'a Item>
Returns items whose prerequisites are all satisfied by resolved_set.
pub fn get(&self, id: &str) -> Option<&Item>
pub fn len(&self) -> usize
pub fn is_empty(&self) -> bool
Trait Implementations§
Auto Trait Implementations§
impl Freeze for ItemRegistry
impl RefUnwindSafe for ItemRegistry
impl Send for ItemRegistry
impl Sync for ItemRegistry
impl Unpin for ItemRegistry
impl UnsafeUnpin for ItemRegistry
impl UnwindSafe for ItemRegistry
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more