Struct sdml_core::cache::ModuleCache
source · pub struct ModuleCache { /* private fields */ }
Implementations§
source§impl ModuleCache
impl ModuleCache
sourcepub fn with_stdlib(self) -> Self
pub fn with_stdlib(self) -> Self
Construct a cache with all of the standard library modules pre-inserted.
sourcepub fn with(self, module: Module) -> Self
pub fn with(self, module: Module) -> Self
Builder-like function to add a module to a newly constructed cache.
pub fn len(&self) -> usize
pub fn is_empty(&self) -> bool
pub fn iter(&self) -> impl Iterator<Item = &Module>
sourcepub fn contains(&self, name: &Identifier) -> bool
pub fn contains(&self, name: &Identifier) -> bool
Returns true
if the loader’s cache contains a module with the name name
, else false
.
pub fn contains_by_uri(&self, uri: &Url) -> bool
pub fn insert(&mut self, module: Module)
pub fn get(&self, name: &Identifier) -> Option<&Module>
pub fn get_mut(&mut self, name: &Identifier) -> Option<&mut Module>
pub fn get_by_uri(&self, uri: &Url) -> Option<&Module>
pub fn get_by_uri_mut(&mut self, uri: &Url) -> Option<&mut Module>
pub fn identifier_for_url(&self, url: &Url) -> Option<&Identifier>
pub fn url_for_identifier(&self, id: &Identifier) -> Option<&Url>
pub fn url_to_identifier_map(&self) -> impl Iterator<Item = (&Url, &Identifier)>
pub fn identifier_to_url_map(&self) -> impl Iterator<Item = (&Identifier, &Url)>
Trait Implementations§
source§impl Clone for ModuleCache
impl Clone for ModuleCache
source§fn clone(&self) -> ModuleCache
fn clone(&self) -> ModuleCache
Returns a copy of the value. Read more
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moresource§impl Debug for ModuleCache
impl Debug for ModuleCache
source§impl Default for ModuleCache
impl Default for ModuleCache
source§fn default() -> ModuleCache
fn default() -> ModuleCache
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl RefUnwindSafe for ModuleCache
impl Send for ModuleCache
impl Sync for ModuleCache
impl Unpin for ModuleCache
impl UnwindSafe for ModuleCache
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