pub struct DependencyStore { /* private fields */ }Expand description
Type-indexed dependency container for runtime and tool contexts.
Implementations§
Source§impl DependencyStore
impl DependencyStore
Sourcepub fn insert<T>(&mut self, value: T)
pub fn insert<T>(&mut self, value: T)
Insert a dependency using its Rust type as the lookup key.
Sourcepub fn insert_arc<T>(&mut self, value: Arc<T>)
pub fn insert_arc<T>(&mut self, value: Arc<T>)
Insert an already shared dependency using its Rust type as the lookup key.
Sourcepub fn insert_named<T>(&mut self, name: impl Into<String>, value: T)
pub fn insert_named<T>(&mut self, name: impl Into<String>, value: T)
Insert a dependency with a caller-provided stable name.
The inserted name becomes the preferred typed lookup for T; older
names remain available through named lookup.
Sourcepub fn insert_named_arc<T>(&mut self, name: impl Into<String>, value: Arc<T>)
pub fn insert_named_arc<T>(&mut self, name: impl Into<String>, value: Arc<T>)
Insert an already shared dependency with a caller-provided stable name.
Replacing a preferred name with another type reindexes any remaining alias for the previous type instead of leaving a stale typed mapping.
Sourcepub fn subset(&self, names: &BTreeSet<String>) -> Self
pub fn subset(&self, names: &BTreeSet<String>) -> Self
Clone a dependency subset selected by stable names.
Typed lookup remains available when the selected name is not the source store’s preferred alias for that type. If several selected names contain the same type, the source store’s preferred alias wins when selected; otherwise stable name order determines the fallback alias.
Trait Implementations§
Source§impl Clone for DependencyStore
impl Clone for DependencyStore
Source§fn clone(&self) -> DependencyStore
fn clone(&self) -> DependencyStore
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more