pub trait ChannelMut: ChannelCore {
// Required methods
fn complete(&mut self) -> bool;
fn abort(&mut self, reason: String) -> bool;
fn pause(&mut self) -> bool;
fn resume(&mut self) -> bool;
fn await_approval(&mut self, request_id: String) -> bool;
fn resolve_approval(&mut self, approval_id: &str) -> Option<String>;
fn add_child(&mut self, id: ChannelId);
fn remove_child(&mut self, id: &ChannelId);
}Expand description
Mutable channel operations.
This trait extends ChannelCore with state transition and tree modification
operations. Separated from ChannelCore to allow read-only access patterns.
Required Methods§
Sourcefn complete(&mut self) -> bool
fn complete(&mut self) -> bool
Transitions to Completed state.
Returns true if transition succeeded, false if not in Running state.
Sourcefn abort(&mut self, reason: String) -> bool
fn abort(&mut self, reason: String) -> bool
Transitions to Aborted state.
Returns true if transition succeeded, false if already terminal.
Sourcefn pause(&mut self) -> bool
fn pause(&mut self) -> bool
Transitions to Paused state.
Returns true if transition succeeded, false if not in Running state.
Sourcefn resume(&mut self) -> bool
fn resume(&mut self) -> bool
Transitions from Paused to Running state.
Returns true if transition succeeded, false if not in Paused state.
Sourcefn await_approval(&mut self, request_id: String) -> bool
fn await_approval(&mut self, request_id: String) -> bool
Transitions to AwaitingApproval state.
Returns true if transition succeeded, false if not in Running state.
Sourcefn resolve_approval(&mut self, approval_id: &str) -> Option<String>
fn resolve_approval(&mut self, approval_id: &str) -> Option<String>
Resolves approval and transitions to Running state.
Only succeeds if the channel is in AwaitingApproval state AND
the stored request_id matches the given approval_id.
Returns the request_id if matched, None otherwise.
Sourcefn remove_child(&mut self, id: &ChannelId)
fn remove_child(&mut self, id: &ChannelId)
Unregisters a child channel.