pub struct Callback<T> {
pub callback_id: String,
/* private fields */
}Expand description
A callback handle that can be used to wait for external signals.
The callback ID can be shared with external systems, which can then signal completion by calling the Lambda durable execution callback API.
Fields§
§callback_id: StringThe unique callback ID
Implementations§
Source§impl<T> Callback<T>where
T: Serialize + DeserializeOwned,
impl<T> Callback<T>where
T: Serialize + DeserializeOwned,
Sourcepub fn id_typed(&self) -> CallbackId
pub fn id_typed(&self) -> CallbackId
Returns the callback ID as a CallbackId newtype.
Sourcepub async fn result(&self) -> Result<T, DurableError>
pub async fn result(&self) -> Result<T, DurableError>
Waits for the callback result.
This method checks if the callback has been signaled. If not, it suspends execution until the callback is received.
§Returns
The callback result on success, or an error if the callback failed, timed out, or execution was suspended.
Trait Implementations§
Auto Trait Implementations§
impl<T> Freeze for Callback<T>
impl<T> !RefUnwindSafe for Callback<T>
impl<T> Send for Callback<T>
impl<T> Sync for Callback<T>
impl<T> Unpin for Callback<T>
impl<T> UnsafeUnpin for Callback<T>
impl<T> !UnwindSafe for Callback<T>
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<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreCreates a shared type from an unshared type.