Type Alias RemoveResourceResultWithContext

Source
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>

Source

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.

Source

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>

Source

pub fn into_removed(self) -> R

A helper function to unwrap a RemoveResourceResult that can never be RemoveResourceResult::Deferred.

Trait Implementations

Source§

impl<R, D> Debug for RemoveResourceResult<R, D>
where R: Debug, D: Debug,

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>

Formats the value using the given formatter. Read more