Skip to main content

CovenBuilder

Struct CovenBuilder 

Source
pub struct CovenBuilder { /* private fields */ }

Implementations§

Source§

impl CovenBuilder

Source

pub fn synced_tables(self, tables: Vec<SyncedTable>) -> Self

Source

pub fn blob_tombstone_grace(self, grace: Duration) -> Self

How long a deleted blob is kept after its tombstone is written before the tombstone GC erases it: the cross-device convergence window. Defaults to coven_protocol::blob::BLOB_TOMBSTONE_GRACE. Must be positive — a zero-or-negative grace is refused at open, since it would let the GC erase a blob a lagging peer still references.

Source

pub fn max_concurrent_uploads(self, n: NonZeroUsize) -> Self

How many blob uploads the sync cycle’s upload drain runs at once. Defaults to one (one at a time). A NonZeroUsize so a zero — which would leave the drain admitting nothing and never completing — cannot be set.

Source

pub fn max_concurrent_downloads(self, n: NonZeroUsize) -> Self

How many blob downloads a pin call fetches at once. Defaults to one (one at a time). A NonZeroUsize so a zero — which would leave the pin loop admitting nothing and never completing — cannot be set.

Source

pub fn migrations(self, migrations: Vec<Migration>) -> Self

The host’s synced-schema migration ladder, applied over PRAGMA user_version at open. The top version is the wire schema_version every changeset is stamped with.

Source

pub fn coven_migration_policy(self, policy: CovenMigrationPolicy) -> Self

Whether this writer may apply pending changes to Coven’s own bookkeeping schema while opening the store.

Source

pub fn clock(self, clock: ClockRef) -> Self

Source

pub fn key_custody(self, custody: KeyCustody) -> Self

How the store’s master key is protected: the OS keyring (the default), a passphrase-wrapped file, an in-memory session value, or a host’s own MasterKeyCustody implementation. coven builds every cipher internally from what this custody supplies — the host never touches a crypto type.

Source

pub fn identity_custody(self, custody: IdentityCustody) -> Self

How this store’s device-signing identity is protected: the OS keyring (the default), a passphrase-wrapped file, an in-memory session value, or a host’s own DeviceIdentityCustody implementation. Selected next to key_custody — the identity is scoped to this store, established as part of creating, joining, or restoring it (see CovenHandle::initialize_identity).

Source

pub fn oauth_clients(self, clients: OAuthClients) -> Self

The OAuth applications this app uses for consumer cloud providers.

Source

pub fn apply_cloudkit_ops(self, ops: Option<Arc<dyn CloudKitOps>>) -> Self

Source

pub fn observer(self, observer: Arc<dyn BlobTransitionObserver>) -> Self

Source

pub fn open(self) -> CovenResult<CovenHandle>

Open the store, returning the CovenHandle.

Opening performs no keyring interaction: it opens the database, runs migrations, and resolves the master-key custody selection to a value (constructing the trait object, never calling its unlock) — a locked agent (no OS keyring session, no established master key or device identity) can open() a store and use it fully for rows and Local blobs. The first read of any key happens lazily, at the specific call that needs it (CovenHandle::connect_sync, CovenHandle::cloud_home_key_state, and similar).

Source

pub fn open_read_only(self) -> CovenResult<CovenReadHandle>

Open the store read-only for a same-store secondary reader: a separate process (or a second handle) that must read rows and blobs while another handle holds the full open. Returns a crate::CovenReadHandle, whose surface is reads only — SQL queries and blob reads — with no write, sync, migration, or stamp API by construction.

Unlike open this takes no store lock (see StoreOpenGuard): it succeeds while a writer holds the exclusive lock, and any number of read-only opens coexist. It opens a SQLITE_OPEN_READONLY connection against the schema on disk and runs no migration ladder. It refuses pending changes to Coven’s bookkeeping schema and host schemas newer than this binary supports. It runs no orphan-temp cleanup either (that is a write the lock-holding writer owns).

SQLite’s locking coordinates the read-only connection with the writer; a blob read that misses locally fetches from the cloud into the per-device cache (files written atomically), which is device scratch and touches no synced state.

Auto Trait Implementations§

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.

§

impl<T> Instrument for T

§

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

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

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
§

impl<Unshared, Shared> IntoShared<Shared> for Unshared
where Shared: FromUnshared<Unshared>,

§

fn into_shared(self) -> Shared

Creates a shared type from an unshared type.
§

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

§

fn and<P, B, E>(self, other: P) -> And<T, P>
where T: 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
§

fn or<P, B, E>(self, other: P) -> Or<T, P>
where T: 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.
§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> WithSubscriber for T

§

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
§

fn with_current_subscriber(self) -> WithDispatch<Self>

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

impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

§

impl<A, B, T> HttpServerConnExec<A, B> for T
where B: Body,

§

impl<T> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,