Struct RecordSync
pub struct RecordSync { /* private fields */ }Expand description
A record’s replication beside one peer.
Implementations§
§impl RecordSync
impl RecordSync
pub fn new() -> RecordSync
pub fn delivered(heads: Vec<ChangeHash>) -> RecordSync
pub fn delivered(heads: Vec<ChangeHash>) -> RecordSync
A record the peer already delivered as heads: what this replica sends
first is what it changed after them, not the record whole again.
pub const fn snapshotted(&self) -> bool
pub const fn snapshotted(&self) -> bool
Whether the peer holds the record whole.
pub fn advance(&mut self, heads: Vec<ChangeHash>)
pub fn advance(&mut self, heads: Vec<ChangeHash>)
The peer accepted everything up to heads.
pub fn take_outbound(
&mut self,
store: &RecordStore,
id: &RecordId,
) -> Result<Option<Outbound>, String>
pub fn take_outbound( &mut self, store: &RecordStore, id: &RecordId, ) -> Result<Option<Outbound>, String>
What this replica sends next: the record whole the first time, the changes the peer lacks after it, whoever made them. Advance with the returned heads once the peer accepted them.
§Errors
The record is not open here or its owner is busy.
pub fn take_own(
&mut self,
store: &RecordStore,
id: &RecordId,
) -> Result<Option<Outbound>, String>
pub fn take_own( &mut self, store: &RecordStore, id: &RecordId, ) -> Result<Option<Outbound>, String>
What this replica made and the peer lacks, for a route that publishes
its own changes alone (RecordStore::own_delta).
§Errors
The record is not open here or its owner is busy.
pub fn merge(
&mut self,
store: &RecordStore,
checkout: &RecordCheckout,
mutation: DocumentMutation,
) -> Result<bool, String>
pub fn merge( &mut self, store: &RecordStore, checkout: &RecordCheckout, mutation: DocumentMutation, ) -> Result<bool, String>
Merge a peer’s mutation into the open record; whether it changed.
What the mutation carried is noted on the frontier, as this replica’s
peers hold it already.
§Errors
The bytes are not a valid mutation of this record, or it is not open.
pub fn set_aside(
&mut self,
store: &RecordStore,
id: &RecordId,
) -> Result<(), String>
pub fn set_aside( &mut self, store: &RecordStore, id: &RecordId, ) -> Result<(), String>
Move this replica’s own changes past the frontier and keep them for
Self::take_set_aside: for a caller that publishes on its own
schedule and cannot take the frontier’s heads itself.
§Errors
The record is not open here or its owner is busy.
pub fn take_set_aside(&mut self) -> Option<DocumentMutation>
pub fn take_set_aside(&mut self) -> Option<DocumentMutation>
Everything Self::set_aside moved since the last call, as one run.
pub fn builds_on(doc: &mut AutoCommit, bytes: &[u8]) -> bool
pub fn builds_on(doc: &mut AutoCommit, bytes: &[u8]) -> bool
Whether bytes build only on changes doc holds: an incremental run
that builds on nothing here belongs to another record, or arrived
ahead of what it builds on.
Trait Implementations§
§impl Default for RecordSync
impl Default for RecordSync
§fn default() -> RecordSync
fn default() -> RecordSync
Auto Trait Implementations§
impl Freeze for RecordSync
impl RefUnwindSafe for RecordSync
impl Send for RecordSync
impl Sync for RecordSync
impl Unpin for RecordSync
impl UnsafeUnpin for RecordSync
impl UnwindSafe for RecordSync
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
§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can
then be further downcast into Box<ConcreteType> where ConcreteType implements Trait.§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be
further downcast into Rc<ConcreteType> where ConcreteType implements Trait.§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>, which can then be
downcast into Box<dyn ConcreteType> where ConcreteType implements Trait.§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Rc<Trait> (where Trait: Downcast) to Rc<Any>, which can then be further
downcast into Rc<ConcreteType> where ConcreteType implements Trait.§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.§impl<T> DowncastSend for T
impl<T> DowncastSend for T
§impl<T> DowncastSync for T
impl<T> DowncastSync for T
§impl<T> DowncastSync for T
impl<T> DowncastSync for T
§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>
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>
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