pub enum WorldCommand {
Spawn {
parent: ChannelId,
config: ChannelConfig,
reply: Sender<Option<ChannelId>>,
},
SpawnWithId {
parent: ChannelId,
id: ChannelId,
config: ChannelConfig,
reply: Sender<bool>,
},
Kill {
id: ChannelId,
reason: String,
},
Complete {
id: ChannelId,
reply: Sender<bool>,
},
UpdateState {
id: ChannelId,
transition: StateTransition,
reply: Sender<bool>,
},
GetState {
id: ChannelId,
reply: Sender<Option<ChannelState>>,
},
Shutdown,
}Expand description
Commands for modifying World state.
These commands are sent to the WorldManager
which applies them sequentially to maintain consistency.
Variants§
Spawn
Spawn a new child channel.
Creates a new channel under the specified parent with the given config. The new channel’s ID is returned via the reply channel.
Fields
config: ChannelConfigConfiguration for the new channel.
SpawnWithId
Spawn a new child channel with a pre-determined ChannelId.
Same as Spawn but the caller supplies the ID.
Used by spawn_runner which needs the ID before the World is updated.
Fields
config: ChannelConfigConfiguration for the new channel.
Kill
Kill a channel and all its descendants.
Removes the channel from the World entirely.
Complete
Complete a channel successfully.
Transitions the channel to Completed state but keeps it in the World.
UpdateState
Update a channel’s state.
Used for state transitions like Pause, Resume, AwaitApproval.
Fields
transition: StateTransitionNew state to transition to.
GetState
Query a channel’s current state (read-only).
For read operations that need consistency with pending writes.
Fields
reply: Sender<Option<ChannelState>>Reply with the current state, or None if not found.
Shutdown
Shutdown the WorldManager.
Signals the manager to stop processing commands.
Trait Implementations§
Auto Trait Implementations§
impl !RefUnwindSafe for WorldCommand
impl !UnwindSafe for WorldCommand
impl Freeze for WorldCommand
impl Send for WorldCommand
impl Sync for WorldCommand
impl Unpin for WorldCommand
impl UnsafeUnpin for WorldCommand
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
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> ⓘ
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> ⓘ
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