Skip to main content

TodoService

Struct TodoService 

Source
pub struct TodoService<'a> { /* private fields */ }

Implementations§

Source§

impl<'a> TodoService<'a>

Source

pub fn new(db: &'a Database) -> Self

Source

pub fn add_todo( &self, task_id: i64, content: &str, options: impl Into<TodoAddOptions>, ) -> Result<Todo>

Source

pub fn get_todo(&self, todo_id: i64) -> Result<Todo>

Source

pub fn list_todos(&self, task_id: i64) -> Result<Vec<Todo>>

Source

pub fn get_todo_by_index(&self, task_id: i64, task_index: i64) -> Result<Todo>

Source

pub fn update_status(&self, todo_id: i64, status: &str) -> Result<()>

Updates a TODO status from a CLI/API string value.

Source

pub fn mark_done(&self, todo_id: i64) -> Result<()>

Marks a TODO as done.

Source

pub fn transition_status( &self, todo_id: i64, new_status: TodoStatus, ) -> Result<()>

Applies a validated status transition.

Source

pub fn clear_legacy_worktree_flags(&self, task_id: Option<i64>) -> Result<usize>

Clears legacy per-TODO worktree_requested flags (jj-task migration).

Source

pub fn delete_todo(&self, todo_id: i64) -> Result<()>

Source

pub fn move_to_next(&self, task_id: i64, task_index: i64) -> Result<()>

Move a TODO to the front (make it the next todo to work on)

This reorders the task_index so that the specified todo becomes the oldest pending todo. Only pending todos are affected by the reordering.

Source

pub fn copy_incomplete_todos( &self, from_task_id: i64, to_task_id: i64, ) -> Result<HashMap<i64, i64>>

Copies incomplete (pending) todos from one task to another.

Returns a mapping of old task_index to new task_index for the copied todos. This mapping is used to copy linked scraps.

§Arguments
  • from_task_id - The task ID to copy from
  • to_task_id - The task ID to copy to
§Returns

A HashMap mapping old task_index values to new task_index values.

Auto Trait Implementations§

§

impl<'a> !RefUnwindSafe for TodoService<'a>

§

impl<'a> !Send for TodoService<'a>

§

impl<'a> !Sync for TodoService<'a>

§

impl<'a> !UnwindSafe for TodoService<'a>

§

impl<'a> Freeze for TodoService<'a>

§

impl<'a> Unpin for TodoService<'a>

§

impl<'a> UnsafeUnpin for TodoService<'a>

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<A, B, T> HttpServerConnExec<A, B> for T
where B: Body,

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more