pub struct BeadStore { /* private fields */ }Expand description
SQLite-backed bead store
BeadStore provides persistent storage for beads (tasks/issues) using SQLite. It handles creation, retrieval, updating, and deletion of beads, as well as managing their dependencies and status transitions.
The store is located at ~/.pawan/beads.db by default.
§Features
- Create, read, update, and delete beads
- Query beads by status, priority, or search term
- Manage bead dependencies
- Track bead history and transitions
- Efficient indexing for large numbers of beads
Implementations§
Source§impl BeadStore
impl BeadStore
Sourcepub fn with_conn(conn: Connection) -> Result<Self>
pub fn with_conn(conn: Connection) -> Result<Self>
Open with custom connection (for testing)
Sourcepub fn create(
&self,
title: &str,
description: Option<&str>,
priority: u8,
) -> Result<Bead>
pub fn create( &self, title: &str, description: Option<&str>, priority: u8, ) -> Result<Bead>
Create a new bead
Sourcepub fn update(
&self,
id: &BeadId,
title: Option<&str>,
status: Option<BeadStatus>,
priority: Option<u8>,
) -> Result<()>
pub fn update( &self, id: &BeadId, title: Option<&str>, status: Option<BeadStatus>, priority: Option<u8>, ) -> Result<()>
Update a bead’s fields
Sourcepub fn close(&self, id: &BeadId, reason: Option<&str>) -> Result<()>
pub fn close(&self, id: &BeadId, reason: Option<&str>) -> Result<()>
Close a bead with optional reason
Sourcepub fn list(
&self,
status: Option<&str>,
max_priority: Option<u8>,
) -> Result<Vec<Bead>>
pub fn list( &self, status: Option<&str>, max_priority: Option<u8>, ) -> Result<Vec<Bead>>
List beads with optional filters
Sourcepub fn dep_add(&self, bead_id: &BeadId, depends_on: &BeadId) -> Result<()>
pub fn dep_add(&self, bead_id: &BeadId, depends_on: &BeadId) -> Result<()>
Add a dependency: bead_id depends on depends_on
Sourcepub fn dep_remove(&self, bead_id: &BeadId, depends_on: &BeadId) -> Result<()>
pub fn dep_remove(&self, bead_id: &BeadId, depends_on: &BeadId) -> Result<()>
Remove a dependency
Sourcepub fn ready(&self) -> Result<Vec<Bead>>
pub fn ready(&self) -> Result<Vec<Bead>>
Ready beads: Open beads whose ALL dependencies are Closed
Sourcepub fn memory_decay(&self, max_age_days: u64) -> Result<usize>
pub fn memory_decay(&self, max_age_days: u64) -> Result<usize>
Memory decay: summarize closed beads older than max_age_days into archive
Auto Trait Implementations§
impl !Freeze for BeadStore
impl !RefUnwindSafe for BeadStore
impl Send for BeadStore
impl !Sync for BeadStore
impl Unpin for BeadStore
impl UnsafeUnpin for BeadStore
impl !UnwindSafe for BeadStore
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> 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