Skip to main content

SqliteRegistryTx

Struct SqliteRegistryTx 

Source
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<'_>

Source§

async fn put_blob( &mut self, command: PutBlobCommand, ) -> RegistryDbResult<BlobRef>

Source§

async fn load_blob(&mut self, blob: BlobRef) -> RegistryDbResult<Vec<u8>>

Source§

impl CommitTx for SqliteRegistryTx<'_>

Source§

impl CrawlStateDb for SqliteRegistryTx<'_>

Source§

impl CrawlTargetDb for SqliteRegistryTx<'_>

Source§

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.
Source§

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>>

Loads the scheduler facts for one active target.
Source§

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<()>

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<()>

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<'_>

Source§

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>

Loads the cursor for a processor, or EventCursor::initial() for a new processor.
Source§

async fn advance_cursor(&mut self, cursor: &EventCursor) -> RegistryDbResult<()>

Advances the processor cursor in the current transaction.
Source§

impl EventJournalAppend for SqliteRegistryTx<'_>

Source§

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<'_>

Source§

async fn load_entries( &mut self, entry_ids: &[EntryId], ) -> RegistryDbResult<Entries>

Source§

async fn apply_feed_update( &mut self, update: &FeedUpdate, ) -> RegistryDbResult<()>

Source§

async fn load_feeds( &mut self, feed_urls: &[FeedUrl], ) -> RegistryDbResult<HashMap<FeedUrl, Feed>>

Source§

impl SubscriptionDb for SqliteRegistryTx<'_>

Source§

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.
Source§

async fn delete_subscription( &mut self, subscriber_id: &SubscriberId, feed_url: &FeedUrl, ) -> RegistryDbResult<()>

Source§

async fn has_subscription( &mut self, subscriber_id: &SubscriberId, feed_url: &FeedUrl, ) -> RegistryDbResult<bool>

Source§

async fn list_subscriptions( &mut self, query: SubscriptionsQuery, ) -> RegistryDbResult<Subscriptions>

Source§

async fn load_feed_subscriptions( &mut self, feed_url: &FeedUrl, ) -> RegistryDbResult<FeedSubscriptions>

Source§

impl TimelineDb for SqliteRegistryTx<'_>

Source§

async fn list_timeline_entries( &mut self, query: TimelineEntriesQuery, ) -> RegistryDbResult<TimelineEntriesPage>

Source§

async fn list_timeline_changes( &mut self, query: TimelineChangesQuery, ) -> RegistryDbResult<TimelineChangesPage>

Source§

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>>

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.
Source§

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> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> IntoEither for T

Source§

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 more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

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
Source§

impl<T> PolicyExt for T
where T: ?Sized,

Source§

fn and<P, B, E>(self, other: P) -> And<T, P>
where T: Sized + Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow only if self and other return Action::Follow. Read more
Source§

fn or<P, B, E>(self, other: P) -> Or<T, P>
where T: Sized + Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow if either self or other returns Action::Follow. Read more
Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more