Struct workflow_rs::core::prelude::Abortable
source · pub struct Abortable(/* private fields */);
Expand description
Abortable trigger wraps an Arc<AtomicBool>
, which can be cloned
to signal task terminating using an atomic bool.
let abortable = Abortable::default();
let result = my_task(abortable).await?;
// ... elsewhere
abortable.abort();
Implementations§
Trait Implementations§
source§impl FromWasmAbi for Abortable
impl FromWasmAbi for Abortable
source§impl IntoWasmAbi for Abortable
impl IntoWasmAbi for Abortable
source§impl LongRefFromWasmAbi for Abortable
impl LongRefFromWasmAbi for Abortable
source§unsafe fn long_ref_from_abi(
js: <Abortable as LongRefFromWasmAbi>::Abi
) -> <Abortable as LongRefFromWasmAbi>::Anchor
unsafe fn long_ref_from_abi( js: <Abortable as LongRefFromWasmAbi>::Abi ) -> <Abortable as LongRefFromWasmAbi>::Anchor
Same as
RefFromWasmAbi::ref_from_abi
source§impl OptionFromWasmAbi for Abortable
impl OptionFromWasmAbi for Abortable
source§impl OptionIntoWasmAbi for Abortable
impl OptionIntoWasmAbi for Abortable
source§impl RefFromWasmAbi for Abortable
impl RefFromWasmAbi for Abortable
§type Anchor = Ref<'static, Abortable>
type Anchor = Ref<'static, Abortable>
The type that holds the reference to
Self
for the duration of the
invocation of the function that has an &Self
parameter. This is
required to ensure that the lifetimes don’t persist beyond one function
call, and so that they remain anonymous.source§unsafe fn ref_from_abi(
js: <Abortable as RefFromWasmAbi>::Abi
) -> <Abortable as RefFromWasmAbi>::Anchor
unsafe fn ref_from_abi( js: <Abortable as RefFromWasmAbi>::Abi ) -> <Abortable as RefFromWasmAbi>::Anchor
source§impl RefMutFromWasmAbi for Abortable
impl RefMutFromWasmAbi for Abortable
source§unsafe fn ref_mut_from_abi(
js: <Abortable as RefMutFromWasmAbi>::Abi
) -> <Abortable as RefMutFromWasmAbi>::Anchor
unsafe fn ref_mut_from_abi( js: <Abortable as RefMutFromWasmAbi>::Abi ) -> <Abortable as RefMutFromWasmAbi>::Anchor
Same as
RefFromWasmAbi::ref_from_abi
source§impl TryFromJsValue for Abortable
impl TryFromJsValue for Abortable
source§impl VectorFromWasmAbi for Abortable
impl VectorFromWasmAbi for Abortable
type Abi = <Box<[JsValue]> as FromWasmAbi>::Abi
unsafe fn vector_from_abi( js: <Abortable as VectorFromWasmAbi>::Abi ) -> Box<[Abortable]>
source§impl VectorIntoWasmAbi for Abortable
impl VectorIntoWasmAbi for Abortable
type Abi = <Box<[JsValue]> as IntoWasmAbi>::Abi
fn vector_into_abi( vector: Box<[Abortable]> ) -> <Abortable as VectorIntoWasmAbi>::Abi
Auto Trait Implementations§
impl RefUnwindSafe for Abortable
impl Send for Abortable
impl Sync for Abortable
impl Unpin for Abortable
impl UnwindSafe for Abortable
Blanket Implementations§
§impl<T> AnySync for T
impl<T> AnySync for T
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
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
source§impl<T> ReturnWasmAbi for Twhere
T: IntoWasmAbi,
impl<T> ReturnWasmAbi for Twhere
T: IntoWasmAbi,
§type Abi = <T as IntoWasmAbi>::Abi
type Abi = <T as IntoWasmAbi>::Abi
Same as
IntoWasmAbi::Abi
source§fn return_abi(self) -> <T as ReturnWasmAbi>::Abi
fn return_abi(self) -> <T as ReturnWasmAbi>::Abi
Same as
IntoWasmAbi::into_abi
, except that it may throw and never
return in the case of Err
.