pub struct Session {
pub comments: Vec<Comment>,
pub viewed: BTreeMap<String, String>,
pub walkthrough: Option<Walkthrough>,
pub seen_stops: BTreeSet<String>,
}Fields§
§comments: Vec<Comment>§viewed: BTreeMap<String, String>Per-file viewed marks: path -> content hash of the new side at the time of marking. A changed hash means the file needs re-review.
walkthrough: Option<Walkthrough>The walkthrough this session is, when its source is
ReviewSource::Walkthrough. Every comment in comments above is this
walkthrough’s: its stops, their notes, and every human reply made on
it. None for every other source.
seen_stops: BTreeSet<String>Walkthrough stops (comment ids) the reader has marked read. Pruned to
the current walkthrough’s stops on every change, so a stop id from a
superseded revision never lingers.
Implementations§
Source§impl Session
impl Session
pub fn add_comment( &mut self, anchor: Anchor, author: &str, body: &str, ) -> &Comment
Sourcepub fn set_walkthrough(&mut self, walkthrough: Walkthrough)
pub fn set_walkthrough(&mut self, walkthrough: Walkthrough)
Set this session’s walkthrough, replacing whatever it held before, and prune seen marks for stops it no longer carries.
Sourcepub fn delete_stop(&mut self, index: usize) -> bool
pub fn delete_stop(&mut self, index: usize) -> bool
Remove one stop and its notes, keeping the walkthrough and its other
stops. false when there is no walkthrough or index is out of range.
Sourcepub fn mark_stop_seen(&mut self, id: &str)
pub fn mark_stop_seen(&mut self, id: &str)
Mark a walkthrough stop read.
pub fn unmark_stop_seen(&mut self, id: &str)
pub fn is_stop_seen(&self, id: &str) -> bool
Sourcepub fn delete_comment(&mut self, id: &str) -> bool
pub fn delete_comment(&mut self, id: &str) -> bool
Remove the comment with id; true when something was deleted.
pub fn reply(&mut self, comment_id: &str, author: &str, body: &str) -> bool
pub fn comment(&self, id: &str) -> Option<&Comment>
Sourcepub fn mark_replied(&mut self, comment_id: &str) -> bool
pub fn mark_replied(&mut self, comment_id: &str) -> bool
Flag a comment as addressed without writing anything into the thread. An agent that already answered has said its piece; a second summary of it is noise in the card.
pub fn resolve(&mut self, comment_id: &str) -> bool
Sourcepub fn edit_comment(&mut self, comment_id: &str, body: &str) -> bool
pub fn edit_comment(&mut self, comment_id: &str, body: &str) -> bool
Replace a comment’s body in place (status, replies, and anchor are kept). No author: an edit corrects the existing comment, it doesn’t attribute a new one.
pub fn mark_viewed(&mut self, path: &str, hash: &str)
pub fn unmark_viewed(&mut self, path: &str)
Sourcepub fn clear_viewed(&mut self)
pub fn clear_viewed(&mut self)
Drop every viewed mark, sending all files back to the review pile.