pub type RemoveResourceResultWithContext<S, BT> = RemoveResourceResult<S, <BT as ReferenceNotifiers>::ReferenceReceiver<S>>;
Expand description
An alias for RemoveResourceResult
that extracts the receiver type from
the bindings context.
Aliased Type§
enum RemoveResourceResultWithContext<S, BT> {
Removed(S),
Deferred(<BT as ReferenceNotifiers>::ReferenceReceiver<S>),
}
Variants§
Removed(S)
The resource was synchronously removed and no more references to it exist.
Deferred(<BT as ReferenceNotifiers>::ReferenceReceiver<S>)
The resource was marked for destruction but there are still references to it in existence. The provided receiver can be polled on to observe resource destruction completion.
Implementations
Source§impl<R, D> RemoveResourceResult<R, D>
impl<R, D> RemoveResourceResult<R, D>
Sourcepub fn map_removed<N, F>(self, f: F) -> RemoveResourceResult<N, D>where
F: FnOnce(R) -> N,
pub fn map_removed<N, F>(self, f: F) -> RemoveResourceResult<N, D>where
F: FnOnce(R) -> N,
Maps the Removed
variant to a different type.
Sourcepub fn map_deferred<N, F>(self, f: F) -> RemoveResourceResult<R, N>where
F: FnOnce(D) -> N,
pub fn map_deferred<N, F>(self, f: F) -> RemoveResourceResult<R, N>where
F: FnOnce(D) -> N,
Maps the Deferred
variant to a different type.
Source§impl<R> RemoveResourceResult<R, Infallible>
impl<R> RemoveResourceResult<R, Infallible>
Sourcepub fn into_removed(self) -> R
pub fn into_removed(self) -> R
A helper function to unwrap a RemoveResourceResult
that can never be
RemoveResourceResult::Deferred
.