pub struct WorkflowConfig {
pub max_node_hops: u32,
pub plugin_call_timeout: Duration,
pub plugin_retry_max: u32,
pub plugin_retry_backoff: Duration,
pub guard_expr_max_length: usize,
pub context_max_size_kb: u32,
pub instance_recovery_batch: u32,
}Expand description
工作流引擎配置,对齐 design 2.1.2。
所有字段均有默认值与取值范围,WorkflowConfig::validate 校验越界。
Fields§
§max_node_hops: u32单次执行最大节点跳转数(死循环防护),默认 10000,范围 [100, 1_000_000]
plugin_call_timeout: Duration插件能力调用超时,默认 5s,范围 [100ms, 60s]
plugin_retry_max: u32插件能力调用重试上限,默认 3,范围 [0, 10]
plugin_retry_backoff: Duration插件能力调用重试初始退避,默认 100ms,范围 [10ms, 10s]
guard_expr_max_length: usize守卫表达式最大长度(字符),默认 1024,范围 [64, 8192]
context_max_size_kb: u32流程上下文最大体积(KB),默认 256,范围 [16, 16384]
instance_recovery_batch: u32故障恢复批量加载实例数,默认 500,范围 [10, 10000]
Implementations§
Source§impl WorkflowConfig
impl WorkflowConfig
Sourcepub fn validate(&self) -> WorkflowResult<()>
pub fn validate(&self) -> WorkflowResult<()>
校验配置取值范围,越界返回 WorkflowError。
Trait Implementations§
Source§impl Clone for WorkflowConfig
impl Clone for WorkflowConfig
Source§impl Debug for WorkflowConfig
impl Debug for WorkflowConfig
Source§impl Default for WorkflowConfig
impl Default for WorkflowConfig
Source§impl<'de> Deserialize<'de> for WorkflowConfig
impl<'de> Deserialize<'de> for WorkflowConfig
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations§
impl Freeze for WorkflowConfig
impl RefUnwindSafe for WorkflowConfig
impl Send for WorkflowConfig
impl Sync for WorkflowConfig
impl Unpin for WorkflowConfig
impl UnsafeUnpin for WorkflowConfig
impl UnwindSafe for WorkflowConfig
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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
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> Pointable for T
impl<T> Pointable for T
impl<T> Read<Exclusive, BecauseExclusive> for Twhere
T: ?Sized,
Source§impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
Source§fn to_subset(&self) -> Option<SS>
fn to_subset(&self) -> Option<SS>
The inverse inclusion map: attempts to construct
self from the equivalent element of its
superset. Read moreSource§fn is_in_subset(&self) -> bool
fn is_in_subset(&self) -> bool
Checks if
self is actually part of its subset T (and can be converted to it).Source§fn to_subset_unchecked(&self) -> SS
fn to_subset_unchecked(&self) -> SS
Use with care! Same as
self.to_subset but without any property checks. Always succeeds.Source§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
The inclusion map: converts
self to the equivalent element of its superset.