pub struct WorkflowContext<'ctx> { /* private fields */ }
Expand description
Workflow handler context.
Implementations§
Trait Implementations§
Source§impl<'ctx> From<(&'ctx ContextInternal, InputMetadata)> for WorkflowContext<'ctx>
impl<'ctx> From<(&'ctx ContextInternal, InputMetadata)> for WorkflowContext<'ctx>
Source§fn from(value: (&'ctx ContextInternal, InputMetadata)) -> Self
fn from(value: (&'ctx ContextInternal, InputMetadata)) -> Self
Converts to this type from the input type.
Auto Trait Implementations§
impl<'ctx> Freeze for WorkflowContext<'ctx>
impl<'ctx> RefUnwindSafe for WorkflowContext<'ctx>
impl<'ctx> Send for WorkflowContext<'ctx>
impl<'ctx> Sync for WorkflowContext<'ctx>
impl<'ctx> Unpin for WorkflowContext<'ctx>
impl<'ctx> UnwindSafe for WorkflowContext<'ctx>
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<'ctx, CTX> ContextAwakeables<'ctx> for CTXwhere
CTX: SealedContext<'ctx>,
impl<'ctx, CTX> ContextAwakeables<'ctx> for CTXwhere
CTX: SealedContext<'ctx>,
Source§fn awakeable<T: Deserialize + 'static>(
&self,
) -> (String, impl DurableFuture<Output = Result<T, TerminalError>> + Send + 'ctx)
fn awakeable<T: Deserialize + 'static>( &self, ) -> (String, impl DurableFuture<Output = Result<T, TerminalError>> + Send + 'ctx)
Create an awakeable
Source§fn resolve_awakeable<T: Serialize + 'static>(&self, key: &str, t: T)
fn resolve_awakeable<T: Serialize + 'static>(&self, key: &str, t: T)
Resolve an awakeable
Source§fn reject_awakeable(&self, key: &str, failure: TerminalError)
fn reject_awakeable(&self, key: &str, failure: TerminalError)
Resolve an awakeable
Source§impl<'ctx, CTX> ContextClient<'ctx> for CTXwhere
CTX: SealedContext<'ctx>,
impl<'ctx, CTX> ContextClient<'ctx> for CTXwhere
CTX: SealedContext<'ctx>,
Source§fn request<Req, Res>(
&self,
request_target: RequestTarget,
req: Req,
) -> Request<'ctx, Req, Res>
fn request<Req, Res>( &self, request_target: RequestTarget, req: Req, ) -> Request<'ctx, Req, Res>
Create a
Request
.Source§fn invocation_handle(
&self,
invocation_id: String,
) -> impl InvocationHandle + 'ctx
fn invocation_handle( &self, invocation_id: String, ) -> impl InvocationHandle + 'ctx
Create an
InvocationHandle
from an invocation id.Source§fn service_client<C>(&self) -> Cwhere
C: IntoServiceClient<'ctx>,
fn service_client<C>(&self) -> Cwhere
C: IntoServiceClient<'ctx>,
Create a service client. The service client is generated by the
restate_sdk_macros::service
macro with the same name of the trait suffixed with Client
. Read moreSource§fn object_client<C>(&self, key: impl Into<String>) -> Cwhere
C: IntoObjectClient<'ctx>,
fn object_client<C>(&self, key: impl Into<String>) -> Cwhere
C: IntoObjectClient<'ctx>,
Create an object client. The object client is generated by the
restate_sdk_macros::object
macro with the same name of the trait suffixed with Client
. Read moreSource§fn workflow_client<C>(&self, key: impl Into<String>) -> Cwhere
C: IntoWorkflowClient<'ctx>,
fn workflow_client<C>(&self, key: impl Into<String>) -> Cwhere
C: IntoWorkflowClient<'ctx>,
Create an workflow client. The workflow client is generated by the
restate_sdk_macros::workflow
macro with the same name of the trait suffixed with Client
. Read moreSource§impl<'ctx, CTX> ContextPromises<'ctx> for CTXwhere
CTX: SealedContext<'ctx> + SealedCanUsePromises,
impl<'ctx, CTX> ContextPromises<'ctx> for CTXwhere
CTX: SealedContext<'ctx> + SealedCanUsePromises,
Source§fn promise<T: Deserialize + 'static>(
&'ctx self,
key: &str,
) -> impl DurableFuture<Output = Result<T, TerminalError>> + 'ctx
fn promise<T: Deserialize + 'static>( &'ctx self, key: &str, ) -> impl DurableFuture<Output = Result<T, TerminalError>> + 'ctx
Create a promise
Source§fn peek_promise<T: Deserialize + 'static>(
&self,
key: &str,
) -> impl Future<Output = Result<Option<T>, TerminalError>> + 'ctx
fn peek_promise<T: Deserialize + 'static>( &self, key: &str, ) -> impl Future<Output = Result<Option<T>, TerminalError>> + 'ctx
Peek a promise
Source§fn resolve_promise<T: Serialize + 'static>(&self, key: &str, t: T)
fn resolve_promise<T: Serialize + 'static>(&self, key: &str, t: T)
Resolve a promise
Source§fn reject_promise(&self, key: &str, failure: TerminalError)
fn reject_promise(&self, key: &str, failure: TerminalError)
Resolve a promise
Source§impl<'ctx, CTX> ContextReadState<'ctx> for CTXwhere
CTX: SealedContext<'ctx> + SealedCanReadState,
impl<'ctx, CTX> ContextReadState<'ctx> for CTXwhere
CTX: SealedContext<'ctx> + SealedCanReadState,
Source§impl<'ctx, CTX> ContextSideEffects<'ctx> for CTXwhere
CTX: SealedContext<'ctx>,
impl<'ctx, CTX> ContextSideEffects<'ctx> for CTXwhere
CTX: SealedContext<'ctx>,
Source§fn run<R, F, T>(
&self,
run_closure: R,
) -> impl RunFuture<Result<T, TerminalError>> + 'ctxwhere
R: RunClosure<Fut = F, Output = T> + Send + 'ctx,
F: Future<Output = HandlerResult<T>> + Send + 'ctx,
T: Serialize + Deserialize + 'static,
fn run<R, F, T>(
&self,
run_closure: R,
) -> impl RunFuture<Result<T, TerminalError>> + 'ctxwhere
R: RunClosure<Fut = F, Output = T> + Send + 'ctx,
F: Future<Output = HandlerResult<T>> + Send + 'ctx,
T: Serialize + Deserialize + 'static,
Journaled actions Read more
Source§fn random_seed(&self) -> u64
fn random_seed(&self) -> u64
Return a random seed inherently predictable, based on the invocation id, which is not secret. Read more
Source§impl<'ctx, CTX> ContextTimers<'ctx> for CTXwhere
CTX: SealedContext<'ctx>,
impl<'ctx, CTX> ContextTimers<'ctx> for CTXwhere
CTX: SealedContext<'ctx>,
Source§fn sleep(
&self,
duration: Duration,
) -> impl DurableFuture<Output = Result<(), TerminalError>> + 'ctx
fn sleep( &self, duration: Duration, ) -> impl DurableFuture<Output = Result<(), TerminalError>> + 'ctx
Sleep using Restate
Source§impl<'ctx, CTX> ContextWriteState<'ctx> for CTXwhere
CTX: SealedContext<'ctx> + SealedCanWriteState,
impl<'ctx, CTX> ContextWriteState<'ctx> for CTXwhere
CTX: SealedContext<'ctx> + SealedCanWriteState,
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 more