Struct DocumentFrontier
pub struct DocumentFrontier { /* private fields */ }Expand description
An explicit outbound synchronization frontier for one document route.
Automerge’s save_incremental cursor is process-global to an AutoCommit:
any full save, debug export, or second transport consumer may advance it.
A frontier instead names the exact heads one destination is known to have,
so serialization is independent of unrelated callers and can later be
advanced from an acknowledgement rather than merely from a send attempt.
Implementations§
§impl DocumentFrontier
impl DocumentFrontier
pub fn diagnostics(&self) -> FrontierDiagnostics
§impl DocumentFrontier
impl DocumentFrontier
pub fn at_document(doc: &mut AutoCommit) -> DocumentFrontier
pub fn at_document(doc: &mut AutoCommit) -> DocumentFrontier
Start at the document’s current heads. Existing content is treated as the baseline; late joiners acquire it through the snapshot handshake.
pub fn take_delta(&mut self, doc: &mut AutoCommit) -> Vec<u8> ⓘ
pub fn take_delta(&mut self, doc: &mut AutoCommit) -> Vec<u8> ⓘ
Serialize everything after this frontier and advance it to the heads
represented by that payload. Unlike save_incremental, this does not
share hidden mutable cursor state with persistence or snapshot export.
pub fn pending_delta(
&mut self,
doc: &mut AutoCommit,
) -> (Vec<u8>, Vec<ChangeHash>)
pub fn pending_delta( &mut self, doc: &mut AutoCommit, ) -> (Vec<u8>, Vec<ChangeHash>)
Build a delta without advancing the frontier. Call Self::advance
only after the durable transport accepts it; a saturated/disconnected
queue can then be retried instead of silently losing the mutation.
pub fn advance(&mut self, heads: Vec<ChangeHash>)
pub fn advance(&mut self, heads: Vec<ChangeHash>)
Advance to heads whose delta a durable destination accepted.
pub fn rebase(&mut self, doc: &mut AutoCommit)
pub fn rebase(&mut self, doc: &mut AutoCommit)
Treat the document’s current state as already observed on this route. Used after applying inbound data so it is not echoed back as a new outbound mutation.
pub fn observe(&mut self, observed: impl IntoIterator<Item = ChangeHash>)
pub fn observe(&mut self, observed: impl IntoIterator<Item = ChangeHash>)
Record changes known to have arrived from this destination without
claiming that it received locally pending changes. The union frontier
lets save_after omit echoes while retaining a rejected local delta.
pub fn heads(&self) -> &[ChangeHash]
Trait Implementations§
§impl Clone for DocumentFrontier
impl Clone for DocumentFrontier
§fn clone(&self) -> DocumentFrontier
fn clone(&self) -> DocumentFrontier
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more§impl Debug for DocumentFrontier
impl Debug for DocumentFrontier
§impl Default for DocumentFrontier
impl Default for DocumentFrontier
§fn default() -> DocumentFrontier
fn default() -> DocumentFrontier
§impl PartialEq for DocumentFrontier
impl PartialEq for DocumentFrontier
§fn eq(&self, other: &DocumentFrontier) -> bool
fn eq(&self, other: &DocumentFrontier) -> bool
self and other values to be equal, and is used by ==.impl Eq for DocumentFrontier
impl StructuralPartialEq for DocumentFrontier
Auto Trait Implementations§
impl Freeze for DocumentFrontier
impl RefUnwindSafe for DocumentFrontier
impl Send for DocumentFrontier
impl Sync for DocumentFrontier
impl Unpin for DocumentFrontier
impl UnsafeUnpin for DocumentFrontier
impl UnwindSafe for DocumentFrontier
Blanket Implementations§
§impl<T> AnyEq for T
impl<T> AnyEq for 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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§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> DowncastSync for T
impl<T> DowncastSync for T
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
§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