pub struct ProviderRef<T> { /* private fields */ }Expand description
Lazy provider handle for forward-reference-style dependencies.
Implementations§
Source§impl<T> ProviderRef<T>
impl<T> ProviderRef<T>
pub fn new(module_ref: ModuleRef, token: ProviderToken) -> Self
pub fn token(&self) -> &ProviderToken
pub fn module_ref(&self) -> &ModuleRef
pub fn get(&self) -> Result<Arc<T>>
pub fn get_optional(&self) -> Result<Option<Arc<T>>>
pub fn resolve(&self) -> Result<Arc<T>>
pub fn resolve_optional(&self) -> Result<Option<Arc<T>>>
Trait Implementations§
Source§impl<T: Clone> Clone for ProviderRef<T>
impl<T: Clone> Clone for ProviderRef<T>
Source§fn clone(&self) -> ProviderRef<T>
fn clone(&self) -> ProviderRef<T>
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 moreAuto Trait Implementations§
impl<T> Freeze for ProviderRef<T>
impl<T> RefUnwindSafe for ProviderRef<T>
impl<T> Send for ProviderRef<T>
impl<T> Sync for ProviderRef<T>
impl<T> Unpin for ProviderRef<T>
impl<T> UnsafeUnpin for ProviderRef<T>
impl<T> UnwindSafe for ProviderRef<T>
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