pub struct Intent {
pub id: IntentId,
pub category: IntentCategory,
pub description: String,
pub tags: Vec<String>,
pub parent_intent: Option<IntentId>,
pub lifecycle: IntentLifecycle,
}Expand description
Why a state change is being made.
Fields§
§id: IntentIdUnique identifier for this intent.
category: IntentCategoryHigh-level category of this intent.
description: StringHuman/agent-readable description of what this intent aims to accomplish.
Queryable labels for filtering and search.
parent_intent: Option<IntentId>If this intent was decomposed from a parent, the parent’s ID. Set via
Intent::with_parent; consumed by Repository::intent_tree to build
the sub-intent hierarchy.
lifecycle: IntentLifecycleCurrent lifecycle state.
Implementations§
Source§impl Intent
impl Intent
Sourcepub fn new(category: IntentCategory, description: impl Into<String>) -> Self
pub fn new(category: IntentCategory, description: impl Into<String>) -> Self
Create a new intent with minimal required fields. Lifecycle starts as Proposed.
Add tags to this intent.
Sourcepub fn with_parent(self, parent_id: IntentId) -> Self
pub fn with_parent(self, parent_id: IntentId) -> Self
Set the parent intent (for decomposition / sub-intents).
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Intent
impl<'de> Deserialize<'de> for Intent
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
impl StructuralPartialEq for Intent
Auto Trait Implementations§
impl Freeze for Intent
impl RefUnwindSafe for Intent
impl Send for Intent
impl Sync for Intent
impl Unpin for Intent
impl UnsafeUnpin for Intent
impl UnwindSafe for Intent
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