pub enum SpawnMode {
Inline,
Child {
background: bool,
inherit_inbox: bool,
policies: Option<Value>,
},
}Expand description
SpawnMode - How a callable spawns child work
Controls execution isolation, inbox routing, and cancellation behavior. Every callable can spawn children - SpawnMode determines HOW.
@see packages/enact-schemas/src/execution.schemas.ts - spawnModeSchema @see docs/TECHNICAL/32-SPAWN-MODE.md
Variants§
Inline
Child work joins parent’s pending_steps queue (same ExecutionId)
- Same execution context
- Same inbox
- Same policies
Child
Child work runs as isolated execution (new ExecutionId with ParentLink)
Implementations§
Source§impl SpawnMode
impl SpawnMode
Sourcepub fn child(background: bool, inherit_inbox: bool) -> Self
pub fn child(background: bool, inherit_inbox: bool) -> Self
Create child spawn mode with options
Sourcepub fn child_with_policies(
background: bool,
inherit_inbox: bool,
policies: Value,
) -> Self
pub fn child_with_policies( background: bool, inherit_inbox: bool, policies: Value, ) -> Self
Create child spawn mode with custom policies
Sourcepub fn is_background(&self) -> bool
pub fn is_background(&self) -> bool
Check if child should run in background
Sourcepub fn inherits_inbox(&self) -> bool
pub fn inherits_inbox(&self) -> bool
Check if child should inherit parent’s inbox
Trait Implementations§
Source§impl<'de> Deserialize<'de> for SpawnMode
impl<'de> Deserialize<'de> for SpawnMode
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
impl Eq for SpawnMode
impl StructuralPartialEq for SpawnMode
Auto Trait Implementations§
impl Freeze for SpawnMode
impl RefUnwindSafe for SpawnMode
impl Send for SpawnMode
impl Sync for SpawnMode
impl Unpin for SpawnMode
impl UnsafeUnpin for SpawnMode
impl UnwindSafe for SpawnMode
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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.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> PolicyExt for Twhere
T: ?Sized,
impl<T> PolicyExt for Twhere
T: ?Sized,
Source§impl<T> ToStringFallible for Twhere
T: Display,
impl<T> ToStringFallible for Twhere
T: Display,
Source§fn try_to_string(&self) -> Result<String, TryReserveError>
fn try_to_string(&self) -> Result<String, TryReserveError>
ToString::to_string, but without panic on OOM.