pub struct WorkflowCtx {
pub gid: String,
pub input: String,
/* private fields */
}Expand description
传给 workflow 函数的上下文。分支都从这里开。
Fields§
§gid: String§input: String提交时带的输入数据,原样透传
Implementations§
Source§impl WorkflowCtx
impl WorkflowCtx
Sourcepub fn branch(&mut self, name: &str) -> BranchBuilder<'_>
pub fn branch(&mut self, name: &str) -> BranchBuilder<'_>
开一个分支。
name 是这个分支的逻辑名字,用来做重放分岔检测 ——
重放时第 N 个分支的名字必须跟上次一致。取个稳定的名字,别用时间戳之类。
Sourcepub fn branch_count(&self) -> usize
pub fn branch_count(&self) -> usize
已经登记过的分支数(含本次运行新增的)
Auto Trait Implementations§
impl !RefUnwindSafe for WorkflowCtx
impl !UnwindSafe for WorkflowCtx
impl Freeze for WorkflowCtx
impl Send for WorkflowCtx
impl Sync for WorkflowCtx
impl Unpin for WorkflowCtx
impl UnsafeUnpin for WorkflowCtx
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
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 moreSource§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
Source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
Wrap the input message
T in a tonic::Request