Skip to main content

Component

Trait Component 

Source
pub trait Component:
    Clone
    + 'static
    + Serialize
    + DeserializeOwned {
    const NAME: &'static str;
}
Expand description

A capability component (spec §3): a unit of data keyed by task Id in the store. Presence of the value is the capability — there is no monolithic Task struct; a task is the set of components attached to its id, fetched and mutated one capability at a time (store.get::<Status>(id) / store.set(id, Status::Wip)). NAME keys the per-capability map/table (spec §7). Adding a capability = a new Component type; the generic store needs no change.

The in-memory store only needs Clone + 'static (typed Box<dyn Any>); the serde bounds are for durable stores that map a component to its row(s).

The Serialize/DeserializeOwned bound lets a store map a component generically to/from its row(s): the Turso adapter (M2) bridges each value through serde_json::to_value/from_value to its typed c_* column(s).

Required Associated Constants§

Source

const NAME: &'static str

Dyn Compatibility§

This trait is not dyn compatible.

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

Implementors§

Source§

impl Component for Archived

Source§

const NAME: &'static str = "archived"

Source§

impl Component for Assignments

Source§

const NAME: &'static str = "assignments"

Source§

impl Component for Attachments

Source§

const NAME: &'static str = "attachments"

Source§

impl Component for Estimate

Source§

const NAME: &'static str = "estimate"

Source§

impl Component for IssueRef

Source§

const NAME: &'static str = "issueref"

Source§

impl Component for Notes

Source§

const NAME: &'static str = "notes"

Source§

impl Component for Recurrence

Source§

const NAME: &'static str = "recurrence"

Source§

impl Component for Schedule

Source§

const NAME: &'static str = "schedule"

Source§

impl Component for Status

Required Status capability (the enum is the component value itself).

Source§

const NAME: &'static str = "status"

Source§

impl Component for Tags

Source§

const NAME: &'static str = "tags"

Source§

impl Component for TimeLog

Source§

const NAME: &'static str = "timelog"

Source§

impl Component for TimeSpent

Source§

const NAME: &'static str = "timespent"

Source§

impl Component for Title

Source§

const NAME: &'static str = "title"