pub struct InitOptions {
pub file: PathBuf,
pub item_type: ItemType,
pub id: Option<String>,
pub name: Option<String>,
pub description: Option<String>,
pub refines: Vec<String>,
pub derives_from: Vec<String>,
pub satisfies: Vec<String>,
pub specification: Option<String>,
pub platform: Option<String>,
pub force: bool,
}Expand description
Options for initializing a new item or adding frontmatter to an existing file.
Fields§
§file: PathBufThe file path to create or update.
item_type: ItemTypeThe item type.
id: Option<String>Optional ID (will be auto-generated if not provided).
name: Option<String>Optional name (will be extracted from file or generated if not provided).
description: Option<String>Optional description.
refines: Vec<String>Upstream references (refines) - valid for use_case and scenario.
derives_from: Vec<String>Upstream references (derives_from) - valid for requirement types.
satisfies: Vec<String>Upstream references (satisfies) - valid for architecture and design types.
specification: Option<String>Specification text - valid for requirement types.
platform: Option<String>Target platform - valid for system_architecture.
force: boolWhether to overwrite existing frontmatter.
Implementations§
Source§impl InitOptions
impl InitOptions
Sourcepub fn new(file: PathBuf, item_type: ItemType) -> Self
pub fn new(file: PathBuf, item_type: ItemType) -> Self
Creates new init options with required fields.
Sourcepub fn with_description(self, description: impl Into<String>) -> Self
pub fn with_description(self, description: impl Into<String>) -> Self
Sets the description.
Sourcepub fn with_refines(self, refines: Vec<String>) -> Self
pub fn with_refines(self, refines: Vec<String>) -> Self
Sets the refines references.
Sourcepub fn with_derives_from(self, derives_from: Vec<String>) -> Self
pub fn with_derives_from(self, derives_from: Vec<String>) -> Self
Sets the derives_from references.
Sourcepub fn with_satisfies(self, satisfies: Vec<String>) -> Self
pub fn with_satisfies(self, satisfies: Vec<String>) -> Self
Sets the satisfies references.
Sourcepub fn with_specification(self, specification: impl Into<String>) -> Self
pub fn with_specification(self, specification: impl Into<String>) -> Self
Sets the specification.
Sourcepub fn with_platform(self, platform: impl Into<String>) -> Self
pub fn with_platform(self, platform: impl Into<String>) -> Self
Sets the platform.
Sourcepub fn with_force(self, force: bool) -> Self
pub fn with_force(self, force: bool) -> Self
Sets the force flag.
Trait Implementations§
Source§impl Clone for InitOptions
impl Clone for InitOptions
Source§fn clone(&self) -> InitOptions
fn clone(&self) -> InitOptions
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreAuto Trait Implementations§
impl Freeze for InitOptions
impl RefUnwindSafe for InitOptions
impl Send for InitOptions
impl Sync for InitOptions
impl Unpin for InitOptions
impl UnwindSafe for InitOptions
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
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>
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>
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