pub struct CoroSuspendOperation<'c> { /* private fields */ }
Expand description
A coro.suspend
operation. Suspends the coroutine.
The async.coro.suspend
suspends the coroutine and transfers control to the
suspend
successor. If suspended coroutine later resumed it will transfer
control to the resume
successor. If it is destroyed it will transfer
control to the the cleanup
successor.
In switched-resume lowering coroutine can be already in resumed state when
suspend operation is called, in this case control will be transferred to the
resume
successor skipping the suspend
successor.
Implementations§
source§impl<'c> CoroSuspendOperation<'c>
impl<'c> CoroSuspendOperation<'c>
sourcepub fn as_operation(&self) -> &Operation<'c>
pub fn as_operation(&self) -> &Operation<'c>
Returns a generic operation.
sourcepub fn builder(
context: &'c Context,
location: Location<'c>
) -> CoroSuspendOperationBuilder<'c, Unset, Unset, Unset, Unset>
pub fn builder( context: &'c Context, location: Location<'c> ) -> CoroSuspendOperationBuilder<'c, Unset, Unset, Unset, Unset>
Creates a builder.
pub fn state(&self) -> Result<Value<'c, '_>, Error>
pub fn suspend_dest(&self) -> Result<BlockRef<'c, '_>, Error>
pub fn resume_dest(&self) -> Result<BlockRef<'c, '_>, Error>
pub fn cleanup_dest(&self) -> Result<BlockRef<'c, '_>, Error>
Trait Implementations§
source§impl<'c> From<CoroSuspendOperation<'c>> for Operation<'c>
impl<'c> From<CoroSuspendOperation<'c>> for Operation<'c>
source§fn from(operation: CoroSuspendOperation<'c>) -> Self
fn from(operation: CoroSuspendOperation<'c>) -> Self
Converts to this type from the input type.
Auto Trait Implementations§
impl<'c> RefUnwindSafe for CoroSuspendOperation<'c>
impl<'c> !Send for CoroSuspendOperation<'c>
impl<'c> !Sync for CoroSuspendOperation<'c>
impl<'c> Unpin for CoroSuspendOperation<'c>
impl<'c> UnwindSafe for CoroSuspendOperation<'c>
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