pub struct WeakComponentInstanceInterface<C: ComponentInstanceInterface> {
pub moniker: Moniker,
/* private fields */
}
Expand description
A wrapper for a weak reference to a type implementing ComponentInstanceInterface
. Provides the
moniker of the component instance, which is useful for error reporting if the original
component instance has been destroyed.
Fields§
§moniker: Moniker
Implementations§
Source§impl<C: ComponentInstanceInterface> WeakComponentInstanceInterface<C>
impl<C: ComponentInstanceInterface> WeakComponentInstanceInterface<C>
pub fn new(component: &Arc<C>) -> Self
Sourcepub fn invalid() -> Self
pub fn invalid() -> Self
Returns a new weak component instance that will always fail to upgrade.
Sourcepub fn upgrade(&self) -> Result<Arc<C>, ComponentInstanceError>
pub fn upgrade(&self) -> Result<Arc<C>, ComponentInstanceError>
Attempts to upgrade this WeakComponentInterface<C>
into an Arc<C>
, if the
original component instance interface C
has not been destroyed.
Trait Implementations§
Source§impl<C: ComponentInstanceInterface> Clone for WeakComponentInstanceInterface<C>
impl<C: ComponentInstanceInterface> Clone for WeakComponentInstanceInterface<C>
Source§impl<C: ComponentInstanceInterface> Debug for WeakComponentInstanceInterface<C>
impl<C: ComponentInstanceInterface> Debug for WeakComponentInstanceInterface<C>
Source§impl<C: ComponentInstanceInterface> Default for WeakComponentInstanceInterface<C>
impl<C: ComponentInstanceInterface> Default for WeakComponentInstanceInterface<C>
Source§impl<C: ComponentInstanceInterface> From<&Arc<C>> for WeakComponentInstanceInterface<C>
impl<C: ComponentInstanceInterface> From<&Arc<C>> for WeakComponentInstanceInterface<C>
Source§impl<C: ComponentInstanceInterface + 'static> From<WeakComponentInstanceInterface<C>> for WeakInstanceToken
impl<C: ComponentInstanceInterface + 'static> From<WeakComponentInstanceInterface<C>> for WeakInstanceToken
Source§fn from(instance: WeakComponentInstanceInterface<C>) -> Self
fn from(instance: WeakComponentInstanceInterface<C>) -> Self
Converts to this type from the input type.
Source§impl<C: ComponentInstanceInterface + 'static> PartialEq for WeakComponentInstanceInterface<C>
impl<C: ComponentInstanceInterface + 'static> PartialEq for WeakComponentInstanceInterface<C>
Source§impl<C: ComponentInstanceInterface + 'static> TryFrom<WeakInstanceToken> for WeakComponentInstanceInterface<C>
impl<C: ComponentInstanceInterface + 'static> TryFrom<WeakInstanceToken> for WeakComponentInstanceInterface<C>
Auto Trait Implementations§
impl<C> Freeze for WeakComponentInstanceInterface<C>
impl<C> RefUnwindSafe for WeakComponentInstanceInterface<C>where
C: RefUnwindSafe,
impl<C> Send for WeakComponentInstanceInterface<C>
impl<C> Sync for WeakComponentInstanceInterface<C>
impl<C> Unpin for WeakComponentInstanceInterface<C>
impl<C> UnwindSafe for WeakComponentInstanceInterface<C>where
C: RefUnwindSafe,
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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit
)