Skip to main content

ChannelMut

Trait ChannelMut 

Source
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§

Source

fn complete(&mut self) -> bool

Transitions to Completed state.

Returns true if transition succeeded, false if not in Running state.

Source

fn abort(&mut self, reason: String) -> bool

Transitions to Aborted state.

Returns true if transition succeeded, false if already terminal.

Source

fn pause(&mut self) -> bool

Transitions to Paused state.

Returns true if transition succeeded, false if not in Running state.

Source

fn resume(&mut self) -> bool

Transitions from Paused to Running state.

Returns true if transition succeeded, false if not in Paused state.

Source

fn await_approval(&mut self, request_id: String) -> bool

Transitions to AwaitingApproval state.

Returns true if transition succeeded, false if not in Running state.

Source

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.

Source

fn add_child(&mut self, id: ChannelId)

Registers a child channel.

Source

fn remove_child(&mut self, id: &ChannelId)

Unregisters a child channel.

Implementors§