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: FnOnce(R) -> N>(
self,
f: F,
) -> RemoveResourceResult<N, D>
pub fn map_removed<N, F: FnOnce(R) -> N>( self, f: F, ) -> RemoveResourceResult<N, D>
Maps the Removed
variant to a different type.
Sourcepub fn map_deferred<N, F: FnOnce(D) -> N>(
self,
f: F,
) -> RemoveResourceResult<R, N>
pub fn map_deferred<N, F: FnOnce(D) -> N>( self, f: F, ) -> RemoveResourceResult<R, 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
.