pub struct SqliteRegistryTx<'a> { /* private fields */ }Expand description
SQLite transaction used to atomically update registry state and event progress.
Trait Implementations§
Source§impl BlobDb for SqliteRegistryTx<'_>
impl BlobDb for SqliteRegistryTx<'_>
async fn put_blob( &mut self, command: PutBlobCommand, ) -> RegistryDbResult<BlobRef>
async fn load_blob(&mut self, blob: BlobRef) -> RegistryDbResult<Vec<u8>>
Source§impl CommitTx for SqliteRegistryTx<'_>
impl CommitTx for SqliteRegistryTx<'_>
async fn commit(self) -> RegistryDbResult<()>
Source§impl CrawlStateDb for SqliteRegistryTx<'_>
impl CrawlStateDb for SqliteRegistryTx<'_>
async fn load_crawl_state( &mut self, feed_url: &FeedUrl, ) -> RegistryDbResult<Option<CrawlState>>
async fn upsert_crawl_state( &mut self, command: UpsertCrawlStateCommand, ) -> RegistryDbResult<()>
Source§impl CrawlTargetDb for SqliteRegistryTx<'_>
impl CrawlTargetDb for SqliteRegistryTx<'_>
Source§async fn upsert_target(&mut self, target: &CrawlTarget) -> RegistryDbResult<()>
async fn upsert_target(&mut self, target: &CrawlTarget) -> RegistryDbResult<()>
Writes the target’s declared state. A pending manual request on the
row is preserved: it belongs to the request/completion lifecycle.
async fn load_target( &mut self, feed_url: &FeedUrl, ) -> RegistryDbResult<Option<CrawlTarget>>
Source§async fn load_crawl_due_input(
&mut self,
feed_url: &FeedUrl,
) -> RegistryDbResult<Option<CrawlDueInput>>
async fn load_crawl_due_input( &mut self, feed_url: &FeedUrl, ) -> RegistryDbResult<Option<CrawlDueInput>>
Loads the scheduler facts for one active target.
Source§async fn list_crawl_due_inputs(
&mut self,
) -> RegistryDbResult<Vec<CrawlDueInput>>
async fn list_crawl_due_inputs( &mut self, ) -> RegistryDbResult<Vec<CrawlDueInput>>
Loads the scheduler facts for every active target.
Source§async fn set_manual_request(
&mut self,
feed_url: &FeedUrl,
requested_at: DateTime<Utc>,
) -> RegistryDbResult<()>
async fn set_manual_request( &mut self, feed_url: &FeedUrl, requested_at: DateTime<Utc>, ) -> RegistryDbResult<()>
Marks a pending manual crawl request unless one is already pending.
Source§async fn clear_manual_request(
&mut self,
feed_url: &FeedUrl,
served_by_crawl_started_at: DateTime<Utc>,
) -> RegistryDbResult<()>
async fn clear_manual_request( &mut self, feed_url: &FeedUrl, served_by_crawl_started_at: DateTime<Utc>, ) -> RegistryDbResult<()>
Clears a pending manual request served by a crawl that started at or
after it. Requests made while the crawl was running stay pending.
Source§impl EventJournal for SqliteRegistryTx<'_>
impl EventJournal for SqliteRegistryTx<'_>
Source§async fn read_after(
&mut self,
cursor: &EventCursor,
interests: EventInterests,
) -> RegistryDbResult<EventReadBatch>
async fn read_after( &mut self, cursor: &EventCursor, interests: EventInterests, ) -> RegistryDbResult<EventReadBatch>
Reads interested entries after the supplied cursor in the current transaction.
Source§async fn load_cursor(
&mut self,
processor: ProcessorId,
) -> RegistryDbResult<EventCursor>
async fn load_cursor( &mut self, processor: ProcessorId, ) -> RegistryDbResult<EventCursor>
Loads the cursor for a processor, or
EventCursor::initial() for a new processor.Source§async fn advance_cursor(&mut self, cursor: &EventCursor) -> RegistryDbResult<()>
async fn advance_cursor(&mut self, cursor: &EventCursor) -> RegistryDbResult<()>
Advances the processor cursor in the current transaction.
Source§impl EventJournalAppend for SqliteRegistryTx<'_>
impl EventJournalAppend for SqliteRegistryTx<'_>
Source§async fn append_event(
&mut self,
event: Event,
occurred_at: DateTime<Utc>,
) -> RegistryDbResult<EventType>
async fn append_event( &mut self, event: Event, occurred_at: DateTime<Utc>, ) -> RegistryDbResult<EventType>
Records that the event happened in the current transaction.
Source§impl FeedDb for SqliteRegistryTx<'_>
impl FeedDb for SqliteRegistryTx<'_>
async fn load_entries( &mut self, entry_ids: &[EntryId], ) -> RegistryDbResult<Entries>
async fn apply_feed_update( &mut self, update: &FeedUpdate, ) -> RegistryDbResult<()>
async fn load_feeds( &mut self, feed_urls: &[FeedUrl], ) -> RegistryDbResult<HashMap<FeedUrl, Feed>>
Source§impl SubscriptionDb for SqliteRegistryTx<'_>
impl SubscriptionDb for SqliteRegistryTx<'_>
Source§async fn upsert_subscription(
&mut self,
subscription: &SubscriptionKey,
attrs: FeedSubscriptionAttrs,
now: DateTime<Utc>,
) -> RegistryDbResult<()>
async fn upsert_subscription( &mut self, subscription: &SubscriptionKey, attrs: FeedSubscriptionAttrs, now: DateTime<Utc>, ) -> RegistryDbResult<()>
Creates or updates the relation.
now becomes subscribed_at on
creation; editing an existing relation keeps the original value.async fn delete_subscription( &mut self, subscriber_id: &SubscriberId, feed_url: &FeedUrl, ) -> RegistryDbResult<()>
async fn has_subscription( &mut self, subscriber_id: &SubscriberId, feed_url: &FeedUrl, ) -> RegistryDbResult<bool>
async fn list_subscriptions( &mut self, query: SubscriptionsQuery, ) -> RegistryDbResult<Subscriptions>
async fn load_feed_subscriptions( &mut self, feed_url: &FeedUrl, ) -> RegistryDbResult<FeedSubscriptions>
Source§impl TimelineDb for SqliteRegistryTx<'_>
impl TimelineDb for SqliteRegistryTx<'_>
async fn list_timeline_entries( &mut self, query: TimelineEntriesQuery, ) -> RegistryDbResult<TimelineEntriesPage>
async fn list_timeline_changes( &mut self, query: TimelineChangesQuery, ) -> RegistryDbResult<TimelineChangesPage>
async fn catchup_subscribed_feed( &mut self, subscriber_id: &SubscriberId, feed_url: &FeedUrl, ) -> RegistryDbResult<TimelineCatchup>
Source§async fn apply_entry_to_timelines(
&mut self,
feed_url: &FeedUrl,
entry_id: &EntryId,
content_changed: bool,
) -> RegistryDbResult<Vec<SubscriberId>>
async fn apply_entry_to_timelines( &mut self, feed_url: &FeedUrl, entry_id: &EntryId, content_changed: bool, ) -> RegistryDbResult<Vec<SubscriberId>>
Applies one entry to the timelines of its subscribers.
content_changed marks that the entry content itself changed, which
bumps the item seq so syncing clients re-read the entry.async fn apply_feed_unsubscribed( &mut self, subscription: &SubscriptionKey, ) -> RegistryDbResult<Option<SubscriberId>>
Auto Trait Implementations§
impl<'a> !RefUnwindSafe for SqliteRegistryTx<'a>
impl<'a> !UnwindSafe for SqliteRegistryTx<'a>
impl<'a> Freeze for SqliteRegistryTx<'a>
impl<'a> Send for SqliteRegistryTx<'a>
impl<'a> Sync for SqliteRegistryTx<'a>
impl<'a> Unpin for SqliteRegistryTx<'a>
impl<'a> UnsafeUnpin for SqliteRegistryTx<'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
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more