Struct Strategy

Source
pub struct Strategy { /* private fields */ }
Expand description

A Strategy document defines high-level approaches to achieve vision goals

Implementations§

Source§

impl Strategy

Source

pub fn new( title: String, parent_id: Option<DocumentId>, blocked_by: Vec<DocumentId>, tags: Vec<Tag>, archived: bool, risk_level: RiskLevel, stakeholders: Vec<String>, ) -> Result<Self, DocumentValidationError>

Create a new Strategy document with content rendered from template

Source

pub fn from_parts( title: String, metadata: DocumentMetadata, content: DocumentContent, parent_id: Option<DocumentId>, blocked_by: Vec<DocumentId>, tags: Vec<Tag>, archived: bool, risk_level: RiskLevel, stakeholders: Vec<String>, ) -> Self

Create a Strategy document from existing data (used when loading from file)

Source

pub fn risk_level(&self) -> RiskLevel

Source

pub fn stakeholders(&self) -> &[String]

Source

pub async fn from_file<P: AsRef<Path>>( path: P, ) -> Result<Self, DocumentValidationError>

Create a Strategy document by reading and parsing a file

Source

pub fn from_content(raw_content: &str) -> Result<Self, DocumentValidationError>

Create a Strategy document from raw file content string

Source

pub async fn to_file<P: AsRef<Path>>( &self, path: P, ) -> Result<(), DocumentValidationError>

Write the Strategy document to a file

Source

pub fn to_content(&self) -> Result<String, DocumentValidationError>

Convert the Strategy document to its markdown string representation using templates

Trait Implementations§

Source§

impl Debug for Strategy

Source§

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

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

impl Document for Strategy

Source§

fn document_type(&self) -> DocumentType

Get the document type
Source§

fn title(&self) -> &str

Get the document title
Source§

fn metadata(&self) -> &DocumentMetadata

Get the document metadata
Source§

fn content(&self) -> &DocumentContent

Get the document content
Source§

fn core(&self) -> &DocumentCore

Get access to the core document data
Source§

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>

Get the parent document ID if this document has a parent
Source§

fn blocked_by(&self) -> &[DocumentId]

Get IDs of documents that block this one
Source§

fn validate(&self) -> Result<(), DocumentValidationError>

Validate the document according to its type-specific rules
Source§

fn exit_criteria_met(&self) -> bool

Check if exit criteria are met
Source§

fn template(&self) -> DocumentTemplate

Get the template for rendering this document type
Source§

fn frontmatter_template(&self) -> &'static str

Get the frontmatter template for this document type
Source§

fn content_template(&self) -> &'static str

Get the content template for this document type
Source§

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>

Transition to the next phase in sequence, or to a specific phase if provided
Source§

fn core_mut(&mut self) -> &mut DocumentCore

Get mutable access to the document core (needed for updates)
Source§

fn id(&self) -> DocumentId

Get the unique identifier for this document (derived from title)
Source§

fn tags(&self) -> &[Tag]

Get the document tags
Source§

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>

Update a specific section (H2 heading) in the document content
Source§

fn update_content_body( &mut self, new_body: String, ) -> Result<(), DocumentValidationError>

Helper method for update_section to actually mutate the content
Source§

fn archived(&self) -> bool

Check if this document is archived

Auto Trait Implementations§

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

Source§

fn into_sql<T>(self) -> Self::Expression

Convert self to an expression for Diesel’s query builder. Read more
Source§

fn as_sql<'a, T>(&'a self) -> <&'a Self as AsExpression<T>>::Expression
where &'a Self: AsExpression<T>, T: SqlType + TypedExpressionType,

Convert &self to an expression for Diesel’s query builder. Read more
Source§

impl<T> Pointable for T

Source§

const ALIGN: usize

The alignment of pointer.
Source§

type Init = T

The type for initializers.
Source§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
Source§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
Source§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
Source§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
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<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V