pub struct NamespaceRegistry<V> { /* private fields */ }Implementations§
Source§impl<V: Clone> NamespaceRegistry<V>
impl<V: Clone> NamespaceRegistry<V>
pub fn new(initial: impl AsRef<str>) -> Self
pub fn current(&self) -> Namespace<V>
pub fn find(&self, name: impl AsRef<str>) -> Option<Namespace<V>>
pub fn find_or_create(&self, name: impl AsRef<str>) -> Namespace<V>
pub fn set_current(&self, name: impl AsRef<str>) -> Namespace<V>
pub fn all(&self) -> Vec<Namespace<V>>
Sourcepub fn known_names(&self) -> Vec<Symbol>
pub fn known_names(&self) -> Vec<Symbol>
Returns every namespace known either as a materialized namespace or as a discoverable module with load state. Catalog-backed modules can therefore be inspected before a Namespace value exists.
pub fn load_state(&self, name: impl AsRef<str>) -> Option<NamespaceLoadState>
pub fn set_load_state(&self, name: impl AsRef<str>, state: NamespaceLoadState)
pub fn clear_load_state(&self, name: impl AsRef<str>)
pub fn load_failure(&self, name: impl AsRef<str>) -> Option<String>
pub fn set_load_failure(&self, name: impl AsRef<str>, detail: impl Into<String>)
pub fn clear_load_failure(&self, name: impl AsRef<str>)
pub fn register_global_alias( &self, alias: impl AsRef<str>, namespace: impl AsRef<str>, ) -> Result<(), String>
pub fn global_aliases(&self) -> Vec<(Symbol, Symbol)>
pub fn register_global_import( &self, shorthand: impl AsRef<str>, canonical: impl AsRef<str>, ) -> Result<(), String>
pub fn global_imports(&self) -> Vec<(Symbol, Symbol)>
pub fn module_revision(&self, name: impl AsRef<str>) -> u64
pub fn commit_module_revision(&self, name: impl AsRef<str>) -> u64
pub fn module_dependencies(&self, name: impl AsRef<str>) -> Vec<Symbol>
pub fn clear_module_dependencies(&self, name: impl AsRef<str>)
pub fn record_module_dependency( &self, module: impl AsRef<str>, dependency: impl AsRef<str>, )
pub fn snapshot(&self) -> NamespaceRegistrySnapshot<V>where
V: 'static,
pub fn transaction_snapshot<'a>(
&self,
names: impl IntoIterator<Item = &'a str>,
) -> NamespaceTransactionSnapshot<V>where
V: 'static,
pub fn restore(&self, snapshot: NamespaceRegistrySnapshot<V>)where
V: 'static,
pub fn restore_transaction(&self, snapshot: NamespaceTransactionSnapshot<V>)where
V: 'static,
pub fn remove(&self, name: impl AsRef<str>) -> Option<Namespace<V>>
pub fn resolve(&self, symbol: &Symbol) -> Option<Var<V>>where
V: Clone,
pub fn set_var(&self, symbol: Symbol, var: Var<V>) -> Result<Var<V>, String>where
V: Clone,
pub fn visible_symbol_names(&self) -> Vec<String>
Trait Implementations§
Source§impl<V: Clone> Clone for NamespaceRegistry<V>
impl<V: Clone> Clone for NamespaceRegistry<V>
Source§fn clone(&self) -> NamespaceRegistry<V>
fn clone(&self) -> NamespaceRegistry<V>
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl<V: Debug> Debug for NamespaceRegistry<V>
impl<V: Debug> Debug for NamespaceRegistry<V>
Auto Trait Implementations§
impl<V> !RefUnwindSafe for NamespaceRegistry<V>
impl<V> !Send for NamespaceRegistry<V>
impl<V> !Sync for NamespaceRegistry<V>
impl<V> !UnwindSafe for NamespaceRegistry<V>
impl<V> Freeze for NamespaceRegistry<V>
impl<V> Unpin for NamespaceRegistry<V>
impl<V> UnsafeUnpin for NamespaceRegistry<V>
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more