pub struct DocumentContext {Show 13 fields
pub title: String,
pub slug: String,
pub created_at: DateTime<Utc>,
pub updated_at: DateTime<Utc>,
pub parent_title: Option<String>,
pub blocked_by: Vec<String>,
pub risk_level: Option<RiskLevel>,
pub stakeholders: Vec<String>,
pub technical_lead: Option<String>,
pub complexity: Option<Complexity>,
pub decision_maker: Option<String>,
pub decision_date: Option<DateTime<Utc>>,
pub number: Option<u32>,
}
Expand description
Context for document creation containing all template variables
Fields§
§title: String
§slug: String
§created_at: DateTime<Utc>
§updated_at: DateTime<Utc>
§parent_title: Option<String>
§blocked_by: Vec<String>
§risk_level: Option<RiskLevel>
§stakeholders: Vec<String>
§technical_lead: Option<String>
§complexity: Option<Complexity>
§decision_maker: Option<String>
§decision_date: Option<DateTime<Utc>>
§number: Option<u32>
Implementations§
Source§impl DocumentContext
impl DocumentContext
Sourcepub fn validate_for_type(&self, doc_type: &DocumentType) -> Result<()>
pub fn validate_for_type(&self, doc_type: &DocumentType) -> Result<()>
Validate context for a specific document type
Sourcepub fn title_to_slug(title: &str) -> String
pub fn title_to_slug(title: &str) -> String
Convert title to URL-friendly slug
Sourcepub fn with_parent(self, parent_title: String) -> Self
pub fn with_parent(self, parent_title: String) -> Self
Builder pattern methods for setting optional fields
pub fn with_blocked_by(self, blocked_by: Vec<String>) -> Self
pub fn with_risk_level(self, risk_level: RiskLevel) -> Self
pub fn with_stakeholders(self, stakeholders: Vec<String>) -> Self
pub fn with_technical_lead(self, technical_lead: String) -> Self
pub fn with_complexity(self, complexity: Complexity) -> Self
pub fn with_decision_maker(self, decision_maker: String) -> Self
pub fn with_decision_date(self, decision_date: DateTime<Utc>) -> Self
pub fn with_number(self, number: u32) -> Self
Trait Implementations§
Source§impl Clone for DocumentContext
impl Clone for DocumentContext
Source§fn clone(&self) -> DocumentContext
fn clone(&self) -> DocumentContext
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreSource§impl Debug for DocumentContext
impl Debug for DocumentContext
Auto Trait Implementations§
impl Freeze for DocumentContext
impl RefUnwindSafe for DocumentContext
impl Send for DocumentContext
impl Sync for DocumentContext
impl Unpin for DocumentContext
impl UnwindSafe for DocumentContext
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more