pub trait ModuleStore {
    // Required methods
    fn len(&self) -> usize;
    fn contains(&self, name: &Identifier) -> bool;
    fn contains_by_uri(&self, uri: &Url) -> bool;
    fn get(&self, name: &Identifier) -> Option<&Module>;
    fn get_mut(&mut self, name: &Identifier) -> Option<&mut Module>;
    fn get_by_uri(&self, uri: &Url) -> Option<&Module>;
    fn get_by_uri_mut(&mut self, uri: &Url) -> Option<&mut Module>;
    fn insert(&mut self, module: Module);
    fn remove(&mut self, name: &Identifier) -> bool;
    fn remove_by_uri(&mut self, uri: &Url) -> bool;

    // Provided method
    fn is_empty(&self) -> bool { ... }
}
Expand description

A trait for any type that /stores/ modules and can retrieve them by name and by URI.

Required Methods§

source

fn len(&self) -> usize

Return the number of modules in the store.

source

fn contains(&self, name: &Identifier) -> bool

Returns true if the loader’s cache contains a module with the name name, else false.

source

fn contains_by_uri(&self, uri: &Url) -> bool

Returns true if the loader’s cache contains a module with the base URI uri, else false.

source

fn get(&self, name: &Identifier) -> Option<&Module>

source

fn get_mut(&mut self, name: &Identifier) -> Option<&mut Module>

source

fn get_by_uri(&self, uri: &Url) -> Option<&Module>

source

fn get_by_uri_mut(&mut self, uri: &Url) -> Option<&mut Module>

source

fn insert(&mut self, module: Module)

source

fn remove(&mut self, name: &Identifier) -> bool

source

fn remove_by_uri(&mut self, uri: &Url) -> bool

Provided Methods§

source

fn is_empty(&self) -> bool

Return true if there are no modules in this store, else false.

Implementors§