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 iter(&self) -> impl Iterator<Item = &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
source§impl ModuleStore for ModuleCache
impl ModuleStore for ModuleCache
source§fn contains(&self, name: &Identifier) -> bool
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
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
.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
Auto Trait Implementations§
impl Freeze for ModuleCache
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
source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§default unsafe fn clone_to_uninit(&self, dst: *mut T)
default unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit
)