pub struct Task { /* private fields */ }Expand description
A Task document represents a concrete, actionable piece of work
Implementations§
Source§impl Task
impl Task
Sourcepub fn new(
title: String,
parent_id: Option<DocumentId>,
parent_title: Option<String>,
strategy_id: Option<DocumentId>,
initiative_id: Option<DocumentId>,
blocked_by: Vec<DocumentId>,
tags: Vec<Tag>,
archived: bool,
) -> Result<Self, DocumentValidationError>
pub fn new( title: String, parent_id: Option<DocumentId>, parent_title: Option<String>, strategy_id: Option<DocumentId>, initiative_id: Option<DocumentId>, blocked_by: Vec<DocumentId>, tags: Vec<Tag>, archived: bool, ) -> Result<Self, DocumentValidationError>
Create a new Task document with content rendered from template
Sourcepub fn from_parts(
title: String,
metadata: DocumentMetadata,
content: DocumentContent,
parent_id: Option<DocumentId>,
strategy_id: Option<DocumentId>,
initiative_id: Option<DocumentId>,
blocked_by: Vec<DocumentId>,
tags: Vec<Tag>,
archived: bool,
) -> Self
pub fn from_parts( title: String, metadata: DocumentMetadata, content: DocumentContent, parent_id: Option<DocumentId>, strategy_id: Option<DocumentId>, initiative_id: Option<DocumentId>, blocked_by: Vec<DocumentId>, tags: Vec<Tag>, archived: bool, ) -> Self
Create a Task document from existing data (used when loading from file)
Sourcepub async fn from_file<P: AsRef<Path>>(
path: P,
) -> Result<Self, DocumentValidationError>
pub async fn from_file<P: AsRef<Path>>( path: P, ) -> Result<Self, DocumentValidationError>
Create a Task document by reading and parsing a file
Sourcepub fn from_content(raw_content: &str) -> Result<Self, DocumentValidationError>
pub fn from_content(raw_content: &str) -> Result<Self, DocumentValidationError>
Create a Task document from raw file content string
Sourcepub async fn to_file<P: AsRef<Path>>(
&self,
path: P,
) -> Result<(), DocumentValidationError>
pub async fn to_file<P: AsRef<Path>>( &self, path: P, ) -> Result<(), DocumentValidationError>
Write the Task document to a file
Sourcepub fn to_content(&self) -> Result<String, DocumentValidationError>
pub fn to_content(&self) -> Result<String, DocumentValidationError>
Convert the Task document to its markdown string representation using templates
Trait Implementations§
Source§impl Document for Task
impl Document for Task
Source§fn document_type(&self) -> DocumentType
fn document_type(&self) -> DocumentType
Get the document type
Source§fn metadata(&self) -> &DocumentMetadata
fn metadata(&self) -> &DocumentMetadata
Get the document metadata
Source§fn content(&self) -> &DocumentContent
fn content(&self) -> &DocumentContent
Get the document content
Source§fn core(&self) -> &DocumentCore
fn core(&self) -> &DocumentCore
Get access to the core document data
Source§fn can_transition_to(&self, phase: Phase) -> bool
fn can_transition_to(&self, phase: Phase) -> bool
Check if this document can transition to the given phase
Source§fn parent_id(&self) -> Option<&DocumentId>
fn parent_id(&self) -> Option<&DocumentId>
Get the parent document ID if this document has a parent
Source§fn blocked_by(&self) -> &[DocumentId]
fn blocked_by(&self) -> &[DocumentId]
Get IDs of documents that block this one
Source§fn validate(&self) -> Result<(), DocumentValidationError>
fn validate(&self) -> Result<(), DocumentValidationError>
Validate the document according to its type-specific rules
Source§fn exit_criteria_met(&self) -> bool
fn exit_criteria_met(&self) -> bool
Check if exit criteria are met
Source§fn template(&self) -> DocumentTemplate
fn template(&self) -> DocumentTemplate
Get the template for rendering this document type
Source§fn frontmatter_template(&self) -> &'static str
fn frontmatter_template(&self) -> &'static str
Get the frontmatter template for this document type
Source§fn content_template(&self) -> &'static str
fn content_template(&self) -> &'static str
Get the content template for this document type
Source§fn acceptance_criteria_template(&self) -> &'static str
fn acceptance_criteria_template(&self) -> &'static str
Get the acceptance criteria template for this document type
Source§fn transition_phase(
&mut self,
target_phase: Option<Phase>,
) -> Result<Phase, DocumentValidationError>
fn transition_phase( &mut self, target_phase: Option<Phase>, ) -> Result<Phase, DocumentValidationError>
Transition to the next phase in sequence, or to a specific phase if provided
Source§fn core_mut(&mut self) -> &mut DocumentCore
fn core_mut(&mut self) -> &mut DocumentCore
Get mutable access to the document core (needed for updates)
Source§fn id(&self) -> DocumentId
fn id(&self) -> DocumentId
Get the unique identifier for this document (derived from title)
Get the document tags
Source§fn phase(&self) -> Result<Phase, DocumentValidationError>
fn phase(&self) -> Result<Phase, DocumentValidationError>
Get the current phase of the document (parsed from tags)
Source§fn update_section(
&mut self,
content: &str,
heading: &str,
append: bool,
) -> Result<(), DocumentValidationError>
fn update_section( &mut self, content: &str, heading: &str, append: bool, ) -> Result<(), DocumentValidationError>
Update a specific section (H2 heading) in the document content
Source§fn update_content_body(
&mut self,
new_body: String,
) -> Result<(), DocumentValidationError>
fn update_content_body( &mut self, new_body: String, ) -> Result<(), DocumentValidationError>
Helper method for update_section to actually mutate the content
Auto Trait Implementations§
impl Freeze for Task
impl RefUnwindSafe for Task
impl Send for Task
impl Sync for Task
impl Unpin for Task
impl UnwindSafe for Task
Blanket Implementations§
Source§impl<T> AggregateExpressionMethods for T
impl<T> AggregateExpressionMethods for T
Source§fn aggregate_distinct(self) -> Self::Outputwhere
Self: DistinctDsl,
fn aggregate_distinct(self) -> Self::Outputwhere
Self: DistinctDsl,
DISTINCT modifier for aggregate functions Read moreSource§fn aggregate_all(self) -> Self::Outputwhere
Self: AllDsl,
fn aggregate_all(self) -> Self::Outputwhere
Self: AllDsl,
ALL modifier for aggregate functions Read moreSource§fn aggregate_filter<P>(self, f: P) -> Self::Output
fn aggregate_filter<P>(self, f: P) -> Self::Output
Add an aggregate function filter Read more
Source§fn aggregate_order<O>(self, o: O) -> Self::Outputwhere
Self: OrderAggregateDsl<O>,
fn aggregate_order<O>(self, o: O) -> Self::Outputwhere
Self: OrderAggregateDsl<O>,
Add an aggregate function order Read more
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
Source§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Converts
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>, which can then be
downcast into Box<dyn ConcreteType> where ConcreteType implements Trait.Source§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Converts
Rc<Trait> (where Trait: Downcast) to Rc<Any>, which can then be further
downcast into Rc<ConcreteType> where ConcreteType implements Trait.Source§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
Converts
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.Source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
Converts
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.Source§impl<T> DowncastSend for T
impl<T> DowncastSend for T
Source§impl<T> DowncastSync for T
impl<T> DowncastSync for T
Source§impl<T> IntoSql for T
impl<T> IntoSql for T
Source§fn into_sql<T>(self) -> Self::Expression
fn into_sql<T>(self) -> Self::Expression
Convert
self to an expression for Diesel’s query builder. Read moreSource§fn as_sql<'a, T>(&'a self) -> <&'a Self as AsExpression<T>>::Expression
fn as_sql<'a, T>(&'a self) -> <&'a Self as AsExpression<T>>::Expression
Convert
&self to an expression for Diesel’s query builder. Read moreSource§impl<T> Pointable for T
impl<T> Pointable for T
Source§impl<T> WindowExpressionMethods for T
impl<T> WindowExpressionMethods for T
Source§fn over(self) -> Self::Outputwhere
Self: OverDsl,
fn over(self) -> Self::Outputwhere
Self: OverDsl,
Turn a function call into a window function call Read more
Source§fn window_filter<P>(self, f: P) -> Self::Output
fn window_filter<P>(self, f: P) -> Self::Output
Add a filter to the current window function Read more
Source§fn partition_by<E>(self, expr: E) -> Self::Outputwhere
Self: PartitionByDsl<E>,
fn partition_by<E>(self, expr: E) -> Self::Outputwhere
Self: PartitionByDsl<E>,
Add a partition clause to the current window function Read more
Source§fn window_order<E>(self, expr: E) -> Self::Outputwhere
Self: OrderWindowDsl<E>,
fn window_order<E>(self, expr: E) -> Self::Outputwhere
Self: OrderWindowDsl<E>,
Add a order clause to the current window function Read more