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>Path to the new side’s content hash when marked. A changed hash means the file needs re-review.
walkthrough: Option<Walkthrough>Set only for a ReviewSource::Walkthrough session.
seen_stops: BTreeSet<String>Stop ids the reader has marked read, pruned to the walkthrough’s
stops on every change.
Implementations§
Source§impl Session
impl Session
pub fn add_comment( &mut self, anchor: Anchor, author: &str, body: &str, ) -> &Comment
pub fn set_walkthrough(&mut self, walkthrough: Walkthrough)
Sourcepub fn delete_stop(&mut self, index: usize) -> bool
pub fn delete_stop(&mut self, index: usize) -> bool
Remove one stop and its notes. false when there is no walkthrough or
index is out of range.
pub fn mark_stop_seen(&mut self, id: &str)
pub fn unmark_stop_seen(&mut self, id: &str)
pub fn is_stop_seen(&self, id: &str) -> bool
pub fn delete_comment(&mut self, id: &str) -> bool
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, writing nothing into the thread.
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, keeping its author, status, replies and anchor.
pub fn mark_viewed(&mut self, path: &str, hash: &str)
pub fn unmark_viewed(&mut self, path: &str)
pub fn clear_viewed(&mut self)
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Session
impl<'de> Deserialize<'de> for Session
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
impl Eq for Session
impl StructuralPartialEq for Session
Auto Trait Implementations§
impl Freeze for Session
impl RefUnwindSafe for Session
impl Send for Session
impl Sync for Session
impl Unpin for Session
impl UnsafeUnpin for Session
impl UnwindSafe for Session
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