pub enum RemoveResourceResult<R, D> {
Removed(R),
Deferred(D),
}
Expand description
The result of removing some reference-counted resource from core.
Variants§
Removed(R)
The resource was synchronously removed and no more references to it exist.
Deferred(D)
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
.
Trait Implementations§
Auto Trait Implementations§
impl<R, D> Freeze for RemoveResourceResult<R, D>
impl<R, D> RefUnwindSafe for RemoveResourceResult<R, D>where
R: RefUnwindSafe,
D: RefUnwindSafe,
impl<R, D> Send for RemoveResourceResult<R, D>
impl<R, D> Sync for RemoveResourceResult<R, D>
impl<R, D> Unpin for RemoveResourceResult<R, D>
impl<R, D> UnwindSafe for RemoveResourceResult<R, D>where
R: UnwindSafe,
D: UnwindSafe,
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<CC, BC, Meta> RecvFrameContext<Meta, BC> for CCwhere
Meta: ReceivableFrameMeta<CC, BC>,
impl<CC, BC, Meta> RecvFrameContext<Meta, BC> for CCwhere
Meta: ReceivableFrameMeta<CC, BC>,
Source§impl<CC, BC, Meta> SendFrameContext<BC, Meta> for CCwhere
Meta: SendableFrameMeta<CC, BC>,
impl<CC, BC, Meta> SendFrameContext<BC, Meta> for CCwhere
Meta: SendableFrameMeta<CC, BC>,
Source§fn send_frame<S>(
&mut self,
bindings_ctx: &mut BC,
metadata: Meta,
frame: S,
) -> Result<(), ErrorAndSerializer<SendFrameErrorReason, S>>where
S: Serializer,
<S as Serializer>::Buffer: BufferMut,
fn send_frame<S>(
&mut self,
bindings_ctx: &mut BC,
metadata: Meta,
frame: S,
) -> Result<(), ErrorAndSerializer<SendFrameErrorReason, S>>where
S: Serializer,
<S as Serializer>::Buffer: BufferMut,
Send a frame. Read more
Source§impl<Id, CC, BC> TimerHandler<BC, Id> for CCwhere
BC: TimerBindingsTypes,
Id: HandleableTimer<CC, BC>,
impl<Id, CC, BC> TimerHandler<BC, Id> for CCwhere
BC: TimerBindingsTypes,
Id: HandleableTimer<CC, BC>,
Source§fn handle_timer(
&mut self,
bindings_ctx: &mut BC,
dispatch: Id,
timer: <BC as TimerBindingsTypes>::UniqueTimerId,
)
fn handle_timer( &mut self, bindings_ctx: &mut BC, dispatch: Id, timer: <BC as TimerBindingsTypes>::UniqueTimerId, )
Handle a timer firing. Read more
Source§impl<L, T> UnlockedAccess<L> for Twhere
L: UnlockedAccessMarkerFor<T>,
impl<L, T> UnlockedAccess<L> for Twhere
L: UnlockedAccessMarkerFor<T>,
Source§type Data = <L as UnlockedAccessMarkerFor<T>>::Data
type Data = <L as UnlockedAccessMarkerFor<T>>::Data
The type of state being accessed.
Source§type Guard<'l> = &'l <L as UnlockedAccessMarkerFor<T>>::Data
where
T: 'l
type Guard<'l> = &'l <L as UnlockedAccessMarkerFor<T>>::Data where T: 'l
A guard providing read access to the data.
Source§fn access(&self) -> <T as UnlockedAccess<L>>::Guard<'_>
fn access(&self) -> <T as UnlockedAccess<L>>::Guard<'_>
How to access the state.