pub struct SourceRepository<'a> { /* private fields */ }Expand description
Repository over the sources table.
Implementations§
Source§impl<'a> SourceRepository<'a>
impl<'a> SourceRepository<'a>
pub fn new(catalog: &'a Catalog) -> Self
Sourcepub fn insert(&self, new: NewSource) -> OrbokResult<SourceRecord>
pub fn insert(&self, new: NewSource) -> OrbokResult<SourceRecord>
Register a source as Active. The transaction requirement of RFC-002 §9 item 1 is satisfied by the single-statement insert.
Sourcepub fn get(&self, id: &SourceId) -> OrbokResult<Option<SourceRecord>>
pub fn get(&self, id: &SourceId) -> OrbokResult<Option<SourceRecord>>
Fetch one source by id.
Sourcepub fn list(&self) -> OrbokResult<Vec<SourceRecord>>
pub fn list(&self) -> OrbokResult<Vec<SourceRecord>>
All sources except Removed, newest first.
Sourcepub fn list_active(&self) -> OrbokResult<Vec<SourceRecord>>
pub fn list_active(&self) -> OrbokResult<Vec<SourceRecord>>
Sources eligible for scanning (Active only, RFC-004 §10).
Sourcepub fn set_status(&self, id: &SourceId, status: SourceStatus) -> OrbokResult<()>
pub fn set_status(&self, id: &SourceId, status: SourceStatus) -> OrbokResult<()>
Update status (pause/resume/missing/permission_denied/removed).
Sourcepub fn touch_scanned(&self, id: &SourceId) -> OrbokResult<()>
pub fn touch_scanned(&self, id: &SourceId) -> OrbokResult<()>
Record a completed scan.
Sourcepub fn delete_with_all_data(&self, id: &SourceId) -> OrbokResult<()>
pub fn delete_with_all_data(&self, id: &SourceId) -> OrbokResult<()>
Remove-source option 3 (RFC-003 §10.3): delete the source row and let foreign keys cascade through files → extraction → chunks → indexes. Source files on disk are never touched.
Auto Trait Implementations§
impl<'a> Freeze for SourceRepository<'a>
impl<'a> RefUnwindSafe for SourceRepository<'a>
impl<'a> Send for SourceRepository<'a>
impl<'a> Sync for SourceRepository<'a>
impl<'a> Unpin for SourceRepository<'a>
impl<'a> UnsafeUnpin for SourceRepository<'a>
impl<'a> UnwindSafe for SourceRepository<'a>
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