pub struct Replica { /* private fields */ }Implementations§
Source§impl Replica
impl Replica
Sourcepub fn open(home: &Path) -> Result<Self>
pub fn open(home: &Path) -> Result<Self>
One replica per cluster directory, beneath a private endpoint state directory.
Sourcepub fn initialize(&mut self, state: &VerifiedState) -> Result<()>
pub fn initialize(&mut self, state: &VerifiedState) -> Result<()>
Install the genesis already verified against an independently pinned anchor.
pub fn load(&self) -> Result<VerifiedState>
Sourcepub fn apply(
&mut self,
expected: &Checkpoint,
updates: &[SignedState],
now: u64,
) -> Result<VerifiedState>
pub fn apply( &mut self, expected: &Checkpoint, updates: &[SignedState], now: u64, ) -> Result<VerifiedState>
Signature validation, history insertion, and checkpoint advancement commit together. Return the new authority only after durable commit. Stale writers must reload.
Sourcepub fn apply_history(
&mut self,
expected: &Checkpoint,
updates: &[SignedState],
) -> Result<VerifiedState>
pub fn apply_history( &mut self, expected: &Checkpoint, updates: &[SignedState], ) -> Result<VerifiedState>
Persist a verified history batch even if still stale. This must not enable delivery until the returned state’s freshness check passes.
Auto Trait Implementations§
impl !Freeze for Replica
impl !RefUnwindSafe for Replica
impl !Sync for Replica
impl !UnwindSafe for Replica
impl Forget for Replica
impl Move for Replica
impl Send for Replicawhere
Connection: Send,
impl Unpin for Replica
impl UnsafeUnpin for Replicawhere
*mut sqlite3: UnsafeUnpin,
*const ArcInner<Mutex<*mut sqlite3>> is !null: UnsafeUnpin,
PhantomData<ArcInner<Mutex<*mut sqlite3>>>: UnsafeUnpin,
*const u8 is !null: UnsafeUnpin,
PhantomData<NonNull<Node<Arc<str>, RawStatement>>>: UnsafeUnpin,
*const Node<Arc<str>, RawStatement> is !null: UnsafeUnpin,
Blanket Implementations§
Source§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
Source§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
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<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
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