pub struct CommentsStore { /* private fields */ }Expand description
Arrow-backed store for item comments.
Implementations§
Source§impl CommentsStore
impl CommentsStore
pub fn new() -> Self
Sourcepub fn add_comment(
&mut self,
item_id: &str,
author: &str,
body: &str,
parent_comment_id: Option<&str>,
) -> Result<String, ArrowError>
pub fn add_comment( &mut self, item_id: &str, author: &str, body: &str, parent_comment_id: Option<&str>, ) -> Result<String, ArrowError>
Add a comment to an item. Returns the allocated comment ID.
Sourcepub fn list_comments(&self, item_id: &str) -> Vec<Comment>
pub fn list_comments(&self, item_id: &str) -> Vec<Comment>
List all comments for an item, ordered by created_at.
Sourcepub fn resolve_comment(&mut self, comment_id: &str) -> bool
pub fn resolve_comment(&mut self, comment_id: &str) -> bool
Resolve a comment by ID. Returns true if found.
Sourcepub fn unresolve_comment(&mut self, comment_id: &str) -> bool
pub fn unresolve_comment(&mut self, comment_id: &str) -> bool
Unresolve a comment by ID. Returns true if found.
Sourcepub fn batches(&self) -> &[RecordBatch]
pub fn batches(&self) -> &[RecordBatch]
Get all batches (for persistence).
Sourcepub fn load(&mut self, batches: Vec<RecordBatch>)
pub fn load(&mut self, batches: Vec<RecordBatch>)
Load pre-existing comment batches (from Parquet).
Sourcepub fn migrate_from_runs(&mut self, runs_batches: &[RecordBatch])
pub fn migrate_from_runs(&mut self, runs_batches: &[RecordBatch])
Migrate legacy comments from the runs table.
Scans for runs where to_status == "comment" and creates proper comment
entries. Does NOT delete original run rows (they’re audit history).
pub fn is_empty(&self) -> bool
Trait Implementations§
Auto Trait Implementations§
impl Freeze for CommentsStore
impl !RefUnwindSafe for CommentsStore
impl Send for CommentsStore
impl Sync for CommentsStore
impl Unpin for CommentsStore
impl UnsafeUnpin for CommentsStore
impl !UnwindSafe for CommentsStore
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