pub struct SqlitePaperTagRepository { /* private fields */ }Implementations§
Source§impl SqlitePaperTagRepository
impl SqlitePaperTagRepository
pub fn new(db: Database) -> Self
Sourcepub fn record(
&self,
paper_id: &str,
tag: &str,
source: &str,
) -> Result<bool, DbError>
pub fn record( &self, paper_id: &str, tag: &str, source: &str, ) -> Result<bool, DbError>
Record a tag. Idempotent on (paper_id, tag) — re-running an
import that already added the tag is a no-op. Returns true
if a new row was inserted, false if it already existed.
Sourcepub fn record_in_tx(
tx: &Transaction<'_>,
paper_id: &str,
tag: &str,
source: &str,
) -> Result<bool, DbError>
pub fn record_in_tx( tx: &Transaction<'_>, paper_id: &str, tag: &str, source: &str, ) -> Result<bool, DbError>
Transactional sibling of Self::record (#157). Used by the
bib-import orchestrator so paper-save + alias / annotation /
tag writes commit (or roll back) as a single unit per row.
Sourcepub fn list_for(&self, paper_id: &str) -> Result<Vec<(String, String)>, DbError>
pub fn list_for(&self, paper_id: &str) -> Result<Vec<(String, String)>, DbError>
All tags for a paper, in insertion order. Returned as
(tag, source) so callers can distinguish bibtex-import-
originated tags from manually-added ones.
Tag names only, in insertion order. Convenience for the export path which only needs the strings (no source metadata).
Trait Implementations§
Source§impl Clone for SqlitePaperTagRepository
impl Clone for SqlitePaperTagRepository
Source§fn clone(&self) -> SqlitePaperTagRepository
fn clone(&self) -> SqlitePaperTagRepository
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl !RefUnwindSafe for SqlitePaperTagRepository
impl !UnwindSafe for SqlitePaperTagRepository
impl Freeze for SqlitePaperTagRepository
impl Send for SqlitePaperTagRepository
impl Sync for SqlitePaperTagRepository
impl Unpin for SqlitePaperTagRepository
impl UnsafeUnpin for SqlitePaperTagRepository
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