Skip to main content

Task

Struct Task 

Source
pub struct Task {
Show 21 fields pub id: String, pub title: String, pub task_type: TaskType, pub priority: u8, pub status: Status, pub parent: Option<String>, pub depends_on: Vec<String>, pub description: String, pub created_at: DateTime<Utc>, pub updated_at: DateTime<Utc>, pub closed_at: Option<DateTime<Utc>>, pub claimed_by: Option<String>, pub branch: Option<String>, pub tags: Vec<String>, pub notes: Vec<Note>, pub links: Vec<Link>, pub closed_children: Vec<ArchivedChild>, pub external: BTreeMap<String, Value>, pub synced_at: BTreeMap<String, DateTime<Utc>>, pub delivered_in: Option<String>, pub extra: BTreeMap<String, Value>,
}

Fields§

§id: String§title: String§task_type: TaskType§priority: u8§status: Status§parent: Option<String>§depends_on: Vec<String>§description: String§created_at: DateTime<Utc>§updated_at: DateTime<Utc>§closed_at: Option<DateTime<Utc>>§claimed_by: Option<String>§branch: Option<String>§tags: Vec<String>§notes: Vec<Note>§links: Vec<Link>§closed_children: Vec<ArchivedChild>§external: BTreeMap<String, Value>§synced_at: BTreeMap<String, DateTime<Utc>>

Per-plugin timestamp of the last time balls applied a push or sync response for this task from the named plugin. Plugins compare their remote’s updated_at against this value for bidirectional conflict resolution without maintaining a side-cache. Written by balls, sent back on every push/sync. Missing keys mean “never synced by that plugin”.

§delivered_in: Option<String>

Performance hint: SHA of the squash-merge on main that delivered this task. Ground truth is the [id] tag embedded in the commit message — see crate::delivery.

§extra: BTreeMap<String, Value>

Forward-compat passthrough. Any top-level JSON field that the current struct doesn’t name lands here on deserialize and round-trips back out on save. Lets an older bl load a task file written by a future version without silently dropping new first-party fields. external already exists for plugin data; extra is the catch-all for everything else.

Implementations§

Source§

impl Task

Source

pub fn generate_id(title: &str, ts: DateTime<Utc>, id_length: usize) -> String

Source

pub fn new(opts: NewTaskOpts, id: String) -> Self

Source

pub fn touch(&mut self)

Source

pub fn append_note(&mut self, author: &str, text: &str)

In-memory note append. Does not persist. For on-disk persistence, use task_io::append_note_to, which writes to the append-only sibling file and is safe for concurrent writers.

Source§

impl Task

Source

pub fn load(path: &Path) -> Result<Self>

Load a task from path. Notes live in a sibling file; load handles both the new layout (notes in sibling) and legacy task files whose notes array is embedded in the JSON. Either way, the returned Task.notes is the union of both sources.

Source

pub fn save(&self, path: &Path) -> Result<()>

Persist a task to path in the text-mergeable format. Never writes the notes sidecar content; use append_note_to for that. Does ensure the notes sidecar exists as an empty file on first save, so that concurrent first-append operations on divergent branches see the file in the merge base and use git’s union merge driver instead of racing on add/add.

Trait Implementations§

Source§

impl Clone for Task

Source§

fn clone(&self) -> Task

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for Task

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<'de> Deserialize<'de> for Task

Source§

fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>
where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
Source§

impl Serialize for Task

Source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more

Auto Trait Implementations§

§

impl Freeze for Task

§

impl RefUnwindSafe for Task

§

impl Send for Task

§

impl Sync for Task

§

impl Unpin for Task

§

impl UnsafeUnpin for Task

§

impl UnwindSafe for Task

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> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

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> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
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> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,