Skip to main content

Crate sofie_db

Crate sofie_db 

Source

Re-exports§

pub use aggregate::Aggregate;
pub use aggregate::Field;
pub use aggregate::Meta;
pub use aggregate::RaisedEvent;
pub use aggregate::Source;
pub use aggregate::read_columns;

Modules§

action
The route or job a commit is made for, which history records beside the actor.
remote
Where a split app serves the apps it left, shared by its server and their clients.
worker

Macros§

embed
A file by its path from the calling crate’s root, the path a development build rereads; compiled = embeds what the build script wrote to OUT_DIR from it instead, and embed!("folder", [names]) gives a &[File].

Structs§

Across
Whether records match across every owner, without any of them leaving: no rows, fields or ids.
Active
AggregateTable
Audited
Null for a record written for no principal, such as by a job.
Backfilled
Broadcasts
Sent through the message table, so it is delivered after the commit.
CatalogColumn
Change
ChangedRecord
ChildTable
Children
Claimed
Its attempt fences every later write, so an expired lease can neither finish nor fail it.
Cohort
Column
Condition
Db
DeadMessage
DeadMessages
Decoding
Default
Making one the default clears it on the owner’s others in the same commit.
Dep
Document
text is the record’s search text, recomputed from the fields Searched names.
Entry
ExpectedRows
Exposed
Extensions
FeedEntry
An event as it crosses apps: its id stays the producer’s, so it is delivered once.
FeedSql
append is serialized by a lock, so a reader past a position never misses an earlier one; receive skips an id already queued; advance moves a cursor only from where it was.
Field
File
A file the binary carries: its source path, which development rereads, and its bytes.
Fired
Guard
Refuses its commit with its field error when a matching record exists by then; replies nothing.
GuardCheck
Keeps its outcome for the committing task to audit: a driver may check on another thread.
Id
IdempotencyKey
InputFields
Jobs
Keyed
Listening
Without a subscription it polls every interval and tries to subscribe again; a renewed subscription ends the wait at once, since a change made while nobody listened woke nobody.
LocalJobs
Sets and cancels jobs at a local time, each under a key the app chooses, such as digest:<account id>, so setting it again moves it.
LocalScheduled
MessageSql
Every insert binds the message columns first, as $1 to $7: id, kind, name, payload, available_at, traceparent, actor.
Messages
Due times follow the app’s clock, so a test can move them; leases follow the database’s.
Meta
MigrationStatus
Migrations
MirrorPage
MirrorRow
Mismatch
ModuleStatus
Page
Paginated
PendingMigration
Plan
PoolSettings
ProductEvents
ProductSql
cohorts answers start, offset, count rows, an offset of -1 counting the cohort.
Prune
Taken by a job, as async fn forget_audits(prune: Prune, clock: Clock).
PublishLock
Query
Queued
RaisedEvent
Read
Has no way to write; its reach is fixed when made and cannot be widened.
RecordsChanges
Reindexing
Retention
Principals by the period of their first start since since, then who raised returning.
Schema
SearchIndex
SearchIndexes
Searched
Selected
SharedBlock
SharedBlocks
ShieldSql
notify is sent on every change.
Showing
Data a screen reads in place, which #[derive(ReadModel)] replies with.
Slugged
SoftDelete
Sort
Sql
'static text takes input only as parameters.
Stamp
Stream
One short query per batch, so no cursor or transaction stays open between them.
TableChange
Timestamps
Topic
UniqueCode
From the id’s random bits; the migration adds the unique index.
UniqueViolation
Uuid
RFC 9562; ordered by bytes so version 7 ids sort in creation order.
Versioned
Every aggregate has it, first.
Work
Write

Enums§

Announced
ChangeKind
Channel
Engine
MessageKind
MigrationState
MismatchKind
Period
Reach
Records without an owner stay readable.
Readers
Repeat
Reply
Step
Topics
Trigger
Unmet
What a statement that touched another number of rows than expected fails with.

Constants§

FEED_PAGE
MATCHES_READ
Meilisearch’s default maxTotalHits; a read filtering matches further sees at most these.
REFERENCE_REFUSAL
SQLite names no foreign key it refuses, so neither engine’s refusal does.
REINDEX_TASK
SEARCH_COLUMN

Traits§

Activates
Aggregate
AnyOutcome
Authored
Behavior
Never runs I/O.
Call
Catalog
Child
ChildRows
Coded
CommitHook
Runs after a commit that wrote aggregates, which already stands, so it cannot fail it. It also runs when the caller is dropped mid-commit, landed or not; slow work goes to a task.
Context
Create
Defaults
Dialect
Rendered SQL is cached by the dialect’s type, so it must not vary per instance.
Driver
Event
FeedSource
FieldNames
The fields an input reads, so a query string’s other keys are told apart before reading.
History
An owned area reads the history of a record its principal owns now, through a parent too.
Input
InputValue
JoinedField
The join reads null for a missing, hidden or other principal’s record, so a joined field is an Option: of the column’s type, or the column’s own Option.
KeyedWork
Load
Lookup
MigrationsLock
Mirror
Notifications
Outcome
Publishes
ReadOnly
What a GET may answer with: its outcome is replied, never committed.
ReplyData
Resolve
RowSink
SearchEngine
Searches
Select
Slugs
SoftDeletes
Source
Timestamped
Update
Uses
Validate
Wakeups
Writes
A GET’s context leaves it out, so a GET cannot take a write-side argument.

Functions§

active
add_commit_hook
Seen by every clone of db, made before or after.
backfill_mirror
bind
Named by the route segment after the aggregate, and within the parents the context names.
cache_driver
For a cache keeping a table of its own and notifying other instances.
changed_field
check_refusal
cohorts
Only events raised by a signed-in principal join a cohort.
column_types
commit_hook
committed_changes
Every change committed from now on, here or by another instance.
delete_softly
deserialize_fields
Every missing, invalid or unknown field is reported before the refusal of try_new.
erase
exclusion_refusal
exposed
exposed_fields
extend
feed_cursor
filterable
forget_principal
Erases the framework’s own rows of a principal, such as product events, and records it for unless_forgotten; planned first, so no write racing the erasure outlives it.
forgotten
hears_other_instances
Whether another instance’s commits reach committed_changes now: always where the database tells no other instance (SQLite), elsewhere only while the listener the first committed_changes started is subscribed. A cache trusts what it holds only while true.
history_of
in_select
Held where column equals selected of a row of B matching condition, in the same query.
index_searches
On the worker of a database a search engine is installed on.
install_search
A database keeps the first engine installed: the worker’s may be the app’s own.
join_all
Polls in order first, so requests sent on a first poll leave as one pipeline.
joined
Null where there is none, where it is hidden, or, in an owned area, another principal’s.
joined_field
lone_value
name_job
optional_lone_value
owned_through
ping_queue
provide
provided
For a remote contract’s server, and a package’s arguments that resolve in a GET too.
query_decoded
query_values
Each row as owned values, for the few reads that have no type to decode into.
read_cached
The answer depends on a cached value, which changes the fingerprint as a read row does.
read_columns
read_feed
read_untracked
The answer depends on another app’s or a vendor’s reply, which no fingerprint here follows.
reads_so_far
Every row read so far in this task; None outside track_reads or after read_untracked.
receive_feed
A consumer racing from the same cursor fails as Conflict. Before any worker is published, entries wait as events; one no listener hears is dropped with a warning after an hour.
refuse_parent_beyond_reach
A list under a parent the read cannot reach, as in /wish-lists/{wish_list}/notes with another principal’s list, is not found: an empty list would say the parent exists.
refuse_unlisted_move
reindex
Each page queues the next, as a mirror’s backfill does, so a stopped worker resumes.
row_values
selects
A list reaches only what its read model shows, so a hidden column cannot be probed by filters.
sweep_expired_keys
Run on a schedule, not by a request: a client must not choose when its request pays for it.
traced_statement
Outside traced work no span opens, or the worker’s polling would trace every second.
track_reads
seed keys the fingerprint by the answer’s other inputs; None when one has no version.
track_topics
unless_forgotten
The commit conflicts if the principal was forgotten since it was read; the retry sees it.

Type Aliases§

BoxFuture
Run
SearchedField