pub struct MappingRegistry { /* private fields */ }Expand description
Enterprise-extensible mapping registry with O(1) lookup [1, 27]
Priority chain: overrides > extensions > core
Implementations§
Source§impl MappingRegistry
impl MappingRegistry
Sourcepub fn with_defaults() -> Self
pub fn with_defaults() -> Self
Create registry with default core mappings
Sourcepub fn lookup(&self, module: &str, item: &str) -> Option<&ItemMapping>
pub fn lookup(&self, module: &str, item: &str) -> Option<&ItemMapping>
Lookup item with priority: overrides > extensions > core
Complexity: O(1) amortized [1]
Sourcepub fn lookup_module(&self, module: &str) -> Option<&LibraryMapping>
pub fn lookup_module(&self, module: &str) -> Option<&LibraryMapping>
Lookup full library mapping with priority
Sourcepub fn register_core(&mut self, mapping: LibraryMapping)
pub fn register_core(&mut self, mapping: LibraryMapping)
Register a core mapping (lowest priority)
Sourcepub fn register_extension(&mut self, mapping: LibraryMapping)
pub fn register_extension(&mut self, mapping: LibraryMapping)
Register an extension mapping (medium priority)
Sourcepub fn register_override(&mut self, mapping: LibraryMapping)
pub fn register_override(&mut self, mapping: LibraryMapping)
Register a user override (highest priority)
Sourcepub fn module_count(&self) -> usize
pub fn module_count(&self) -> usize
Get count of all registered modules
Trait Implementations§
Source§impl Debug for MappingRegistry
impl Debug for MappingRegistry
Source§impl Default for MappingRegistry
impl Default for MappingRegistry
Source§fn default() -> MappingRegistry
fn default() -> MappingRegistry
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for MappingRegistry
impl RefUnwindSafe for MappingRegistry
impl Send for MappingRegistry
impl Sync for MappingRegistry
impl Unpin for MappingRegistry
impl UnwindSafe for MappingRegistry
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> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
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