pub struct DependencyValues { /* private fields */ }Expand description
Typed dependency bag keyed by TypeId (UDF DependencyValues).
Reads use a shared RwLock read guard; writes take an exclusive guard.
Clone is cheap (shared map).
Implementations§
Source§impl DependencyValues
impl DependencyValues
pub fn new() -> DependencyValues
pub fn insert<D>(&self, value: D)
pub fn get<D>(&self) -> Option<Arc<D>>
pub fn contains<D>(&self) -> bool
pub fn remove<D>(&self) -> Option<Arc<D>>
pub fn get_or_insert_with<D, F>(&self, f: F) -> Arc<D> ⓘ
pub fn require<D>(&self) -> Result<Arc<D>, DependencyError>
pub fn with<D>(self, value: D) -> DependencyValues
pub fn merge_from(&self, overlay: &DependencyValues)
Sourcepub fn live() -> DependencyValues
pub fn live() -> DependencyValues
Live dependency set for production runtimes.
Sourcepub fn test() -> DependencyValues
pub fn test() -> DependencyValues
Test dependency set with deterministic built-ins.
Trait Implementations§
Source§impl Clone for DependencyValues
impl Clone for DependencyValues
Source§fn clone(&self) -> DependencyValues
fn clone(&self) -> DependencyValues
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 Default for DependencyValues
impl Default for DependencyValues
Source§fn default() -> DependencyValues
fn default() -> DependencyValues
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl !RefUnwindSafe for DependencyValues
impl !UnwindSafe for DependencyValues
impl Freeze for DependencyValues
impl Send for DependencyValues
impl Sync for DependencyValues
impl Unpin for DependencyValues
impl UnsafeUnpin for DependencyValues
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