pub struct DurableReplica<C: Crdt> { /* private fields */ }Expand description
Additive durable API for Linux local filesystems. The root must already exist durably and remain in place; all writers use the same fixed root and configuration. Each Accepted/Ok(record) follows full transaction replacement and file + directory sync. Any persistence error permanently disables this instance’s writes, retaining its fence until drop. Use the explicit restart constructors for existing stores; fresh constructors never reset a store.
Implementations§
Source§impl<C: Crdt> DurableReplica<C>
impl<C: Crdt> DurableReplica<C>
pub fn state(&self) -> &C
pub fn log(&self) -> &EventLog<C::Delta>
pub fn allocation_bytes(&self) -> Vec<u8> ⓘ
pub fn ticket(&self) -> WriteTicket
pub fn renew(&mut self, ticket: WriteTicket) -> Result<WriteTicket, LocalError>
pub fn receive( &mut self, ticket: WriteTicket, record: Record<C::Delta>, ) -> Result<Admission, LocalError>
pub fn append( &mut self, ticket: WriteTicket, delta: C::Delta, ) -> Result<Record<C::Delta>, LocalError>
Source§impl DurableReplica<GCounter>
impl DurableReplica<GCounter>
Sourcepub fn restart_counter(
root: &Path,
config: WriterConfig,
) -> Result<Self, LocalError>
pub fn restart_counter( root: &Path, config: WriterConfig, ) -> Result<Self, LocalError>
Reacquire ownership, validate the committed history and replay fresh state. Any error returns no replica and grants no write ticket.
pub fn counter(root: &Path, config: WriterConfig) -> Result<Self, LocalError>
pub fn bump( &mut self, ticket: WriteTicket, tally: u64, ) -> Result<Record<GCounterDelta>, LocalError>
Source§impl DurableReplica<OrSet<String, u64>>
impl DurableReplica<OrSet<String, u64>>
Sourcepub fn restart_utf8_set(
root: &Path,
config: WriterConfig,
) -> Result<Self, LocalError>
pub fn restart_utf8_set( root: &Path, config: WriterConfig, ) -> Result<Self, LocalError>
Checked ordinary restart, including tombstones and token allocation.
pub fn utf8_set(root: &Path, config: WriterConfig) -> Result<Self, LocalError>
pub fn add( &mut self, ticket: WriteTicket, element: String, ) -> Result<Record<OrSetDelta<String, u64>>, LocalError>
pub fn remove( &mut self, ticket: WriteTicket, element: &String, ) -> Result<Record<OrSetDelta<String, u64>>, LocalError>
Auto Trait Implementations§
impl<C> Freeze for DurableReplica<C>where
C: Freeze,
impl<C> RefUnwindSafe for DurableReplica<C>
impl<C> Send for DurableReplica<C>
impl<C> Sync for DurableReplica<C>
impl<C> Unpin for DurableReplica<C>
impl<C> UnsafeUnpin for DurableReplica<C>where
C: UnsafeUnpin,
impl<C> UnwindSafe for DurableReplica<C>
Blanket Implementations§
Source§impl<T> Any for Twhere
T: 'static + ?Sized,
impl<T> Any for Twhere
T: 'static + ?Sized,
Source§fn type_id(&self) -> TypeId
fn type_id(&self) -> TypeId
TypeId of self. Read moreSource§impl<T> Borrow<T> for Twhere
T: ?Sized,
impl<T> Borrow<T> for Twhere
T: ?Sized,
Source§fn borrow(&self) -> &T
fn borrow(&self) -> &T
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
Source§impl<T, U> Into<U> for Twhere
U: From<T>,
impl<T, U> Into<U> for Twhere
U: From<T>,
Source§fn into(self) -> U
fn into(self) -> U
Calls U::from(self).
That is, this conversion is whatever the implementation of
From<T> for U chooses to do.