Skip to main content

TodoStateProvider

Trait TodoStateProvider 

Source
pub trait TodoStateProvider: Send + Sync {
    // Required methods
    fn get_phases(&self) -> Vec<TodoPhase>;
    fn apply_ops<'a>(
        &'a self,
        ops: Vec<TodoOp>,
    ) -> Pin<Box<dyn Future<Output = Result<TodoUpdateResult, ToolError>> + Send + 'a>>;
}
Expand description

Trait abstracting where todo state lives. Implemented by hosts (e.g. oxicode-cli::store::TodoState) so the stateless TodoTool and the TUI sticky panel share one source of truth.

Required Methods§

Source

fn get_phases(&self) -> Vec<TodoPhase>

Snapshot of the current phases (cheap clone expected).

Source

fn apply_ops<'a>( &'a self, ops: Vec<TodoOp>, ) -> Pin<Box<dyn Future<Output = Result<TodoUpdateResult, ToolError>> + Send + 'a>>

Apply a batch of ops asynchronously. The returned future is Send so it can be driven from a worker task.

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§