pub struct ThoughtBranch {
pub branch_id: String,
pub parent_thought: u32,
pub thoughts: Vec<ThoughtData>,
pub metadata: HashMap<String, Value>,
pub created_at: DateTime<Utc>,
}Expand description
A collection of thoughts that form a branch
Fields§
§branch_id: StringBranch identifier
parent_thought: u32Parent thought number
thoughts: Vec<ThoughtData>Thoughts in this branch
metadata: HashMap<String, Value>Branch metadata
created_at: DateTime<Utc>When the branch was created
Implementations§
Source§impl ThoughtBranch
impl ThoughtBranch
Sourcepub fn add_thought(&mut self, thought: ThoughtData)
pub fn add_thought(&mut self, thought: ThoughtData)
Add a thought to this branch
Sourcepub fn thought_count(&self) -> usize
pub fn thought_count(&self) -> usize
Get the number of thoughts in this branch
Sourcepub fn latest_thought(&self) -> Option<&ThoughtData>
pub fn latest_thought(&self) -> Option<&ThoughtData>
Get the latest thought in this branch
Trait Implementations§
Source§impl Clone for ThoughtBranch
impl Clone for ThoughtBranch
Source§fn clone(&self) -> ThoughtBranch
fn clone(&self) -> ThoughtBranch
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 ThoughtBranch
impl Debug for ThoughtBranch
Source§impl<'de> Deserialize<'de> for ThoughtBranch
impl<'de> Deserialize<'de> for ThoughtBranch
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
Auto Trait Implementations§
impl Freeze for ThoughtBranch
impl RefUnwindSafe for ThoughtBranch
impl Send for ThoughtBranch
impl Sync for ThoughtBranch
impl Unpin for ThoughtBranch
impl UnwindSafe for ThoughtBranch
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