pub struct SqliteShortlistRepository { /* private fields */ }Implementations§
Source§impl SqliteShortlistRepository
impl SqliteShortlistRepository
pub fn new(db: Database) -> Self
Sourcepub fn contains(
&self,
question_id: &str,
paper_id: &str,
reader: &str,
) -> Result<bool, DbError>
pub fn contains( &self, question_id: &str, paper_id: &str, reader: &str, ) -> Result<bool, DbError>
Is this paper on reader’s shortlist for question_id?
Sourcepub fn toggle(
&self,
question_id: &str,
paper_id: &str,
reader: &str,
) -> Result<bool, DbError>
pub fn toggle( &self, question_id: &str, paper_id: &str, reader: &str, ) -> Result<bool, DbError>
Toggle membership. Returns the post-toggle state (true = on
shortlist). Matches the TUI’s c keybind and MCP
toggle_shortlist semantics. Does the whole check-and-swap
under one pool connection to avoid deadlocking the single-
connection in-memory test DB.
Sourcepub fn list(
&self,
question_id: &str,
reader: &str,
) -> Result<Vec<String>, DbError>
pub fn list( &self, question_id: &str, reader: &str, ) -> Result<Vec<String>, DbError>
Paper IDs on reader’s shortlist for question_id, in
added-at-ascending order (the order the reader built the list).
Sourcepub fn members_set(
&self,
question_id: &str,
reader: &str,
) -> Result<HashSet<String>, DbError>
pub fn members_set( &self, question_id: &str, reader: &str, ) -> Result<HashSet<String>, DbError>
paper_id set for use as a contains-check in render loops —
cheaper than N per-row contains calls.
Sourcepub fn max_updated_at_for_question(
&self,
question_id: &str,
) -> Result<Option<String>, DbError>
pub fn max_updated_at_for_question( &self, question_id: &str, ) -> Result<Option<String>, DbError>
Latest update timestamp across the tables that the bib watch
engine considers shared-document state for question_id:
papers rows referenced by the shortlist, paper_state rows
for those papers, and shortlist_members membership changes.
Returns None when the question has no shortlist or all
touched tables are empty. Caller compares string equality
(RFC3339 timestamps are lex-comparable per ISO 8601).
Note: stars are personal-view state and are filtered at the
watch-engine layer, NOT excluded here — the engine ignores
changes whose only signal is paper_state.starred flipping.
This query also doesn’t join annotations directly: the
import-side bib-content build folds annotation note= text
through the paper row, so a meaningful annotation change
surfaces via papers.updated_at.
Trait Implementations§
Source§impl Clone for SqliteShortlistRepository
impl Clone for SqliteShortlistRepository
Source§fn clone(&self) -> SqliteShortlistRepository
fn clone(&self) -> SqliteShortlistRepository
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more