pub struct ThoughtData {
pub thought: String,
pub thought_number: u32,
pub total_thoughts: u32,
pub next_thought_needed: bool,
pub is_revision: Option<bool>,
pub revises_thought: Option<u32>,
pub branch_from_thought: Option<u32>,
pub branch_id: Option<String>,
pub needs_more_thoughts: Option<bool>,
pub timestamp: Option<DateTime<Utc>>,
pub metadata: Option<HashMap<String, Value>>,
}Expand description
Core data structure for a single thought in the sequential thinking process
Fields§
§thought: StringThe actual thought content
thought_number: u32Current thought number in the sequence
total_thoughts: u32Estimated total number of thoughts needed
next_thought_needed: boolWhether another thought step is needed
is_revision: Option<bool>Whether this thought revises previous thinking
revises_thought: Option<u32>Which thought is being reconsidered (if this is a revision)
branch_from_thought: Option<u32>Branching point thought number (if this is a branch)
branch_id: Option<String>Branch identifier (if this is a branch)
needs_more_thoughts: Option<bool>Whether more thoughts are needed (if reaching end but realizing more needed)
timestamp: Option<DateTime<Utc>>Timestamp when this thought was created
metadata: Option<HashMap<String, Value>>Metadata associated with this thought
Implementations§
Source§impl ThoughtData
impl ThoughtData
Sourcepub fn new(thought: String, thought_number: u32, total_thoughts: u32) -> Self
pub fn new(thought: String, thought_number: u32, total_thoughts: u32) -> Self
Create a new thought with basic information
Sourcepub fn revision(
thought: String,
thought_number: u32,
revises_thought: u32,
) -> Self
pub fn revision( thought: String, thought_number: u32, revises_thought: u32, ) -> Self
Create a revision thought
Sourcepub fn branch(
thought: String,
thought_number: u32,
branch_from_thought: u32,
branch_id: String,
) -> Self
pub fn branch( thought: String, thought_number: u32, branch_from_thought: u32, branch_id: String, ) -> Self
Create a branch thought
Sourcepub fn is_revision(&self) -> bool
pub fn is_revision(&self) -> bool
Check if this thought is a revision
Sourcepub fn get_branch_id(&self) -> Option<&str>
pub fn get_branch_id(&self) -> Option<&str>
Get the branch ID if this is a branch
Sourcepub fn get_revised_thought(&self) -> Option<u32>
pub fn get_revised_thought(&self) -> Option<u32>
Get the thought being revised if this is a revision
Sourcepub fn with_metadata(self, key: String, value: Value) -> Self
pub fn with_metadata(self, key: String, value: Value) -> Self
Add metadata to this thought
Trait Implementations§
Source§impl Clone for ThoughtData
impl Clone for ThoughtData
Source§fn clone(&self) -> ThoughtData
fn clone(&self) -> ThoughtData
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more