pub struct IrohDbBuilder { /* private fields */ }Expand description
Opens a database with the exact deterministic schema migrations understood by this application version.
Implementations§
Source§impl IrohDbBuilder
impl IrohDbBuilder
Sourcepub fn key_provider(self, provider: Arc<dyn KeyProvider>) -> Self
pub fn key_provider(self, provider: Arc<dyn KeyProvider>) -> Self
Uses an application-managed identity and domain-key provider instead of the default file vault beneath the database directory.
Sourcepub const fn defer_migrations(self) -> Self
pub const fn defer_migrations(self) -> Self
Defers migration work until IrohDb::run_migrations is called.
Sourcepub fn migration<From, To>(
self,
transform: fn(From) -> Result<To, MigrationError>,
) -> Result<Self, MigrationError>
pub fn migration<From, To>( self, transform: fn(From) -> Result<To, MigrationError>, ) -> Result<Self, MigrationError>
Registers one exact adjacent schema migration. The transform is a function pointer so durable behavior cannot depend on captured runtime state.
Sourcepub async fn open(self) -> Result<IrohDb, DbError>
pub async fn open(self) -> Result<IrohDb, DbError>
Opens the local database, registers historical adapters, and resumes every applicable migration before returning a readable handle.
Sourcepub async fn open_with_report(
self,
) -> Result<(IrohDb, MigrationReport), DbError>
pub async fn open_with_report( self, ) -> Result<(IrohDb, MigrationReport), DbError>
Opens the database and returns exact migration work performed while opening.
Auto Trait Implementations§
impl Freeze for IrohDbBuilder
impl !RefUnwindSafe for IrohDbBuilder
impl Send for IrohDbBuilder
impl Sync for IrohDbBuilder
impl Unpin for IrohDbBuilder
impl !UnwindSafe for IrohDbBuilder
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
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§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