pub struct Task {
pub frontmatter: TaskFrontmatter,
pub body: String,
pub source: Option<String>,
}Expand description
A task with its content.
Fields§
§frontmatter: TaskFrontmatterFrontmatter metadata.
body: StringMarkdown body content.
source: Option<String>Source file path (if loaded from file).
Implementations§
Source§impl Task
impl Task
Sourcepub fn status(&self) -> TaskStatus
pub fn status(&self) -> TaskStatus
Get the task status.
Sourcepub fn depends_on(&self) -> &[String]
pub fn depends_on(&self) -> &[String]
Get the task dependencies.
Sourcepub fn from_markdown(content: &str, source: Option<String>) -> Result<Self>
pub fn from_markdown(content: &str, source: Option<String>) -> Result<Self>
Parse a task from markdown content.
§Errors
Returns an error if the frontmatter is invalid or missing required fields.
Sourcepub fn to_markdown(&self) -> Result<String, Error>
pub fn to_markdown(&self) -> Result<String, Error>
Serialize the task to markdown.
Trait Implementations§
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> 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