Struct Update
pub struct Update { /* private fields */ }Expand description
Update type which contains an information about all decoded blocks which are incoming from a remote peer. Since these blocks are not yet integrated into current document’s block store, they still may require repairing before doing so as they don’t contain full data about their relations.
Update is conceptually similar to a block store itself, however the work patters are different.
Implementations§
§impl Update
impl Update
pub const EMPTY_V1: &'static [u8]
pub const EMPTY_V1: &'static [u8]
Binary containing an empty update, serialized via lib0 version 1 encoder.
pub const EMPTY_V2: &'static [u8]
pub const EMPTY_V2: &'static [u8]
Binary containing an empty update, serialized via lib0 version 2 encoder.
pub fn new() -> Update
pub fn extends(&self, state_vector: &StateVector) -> bool
pub fn extends(&self, state_vector: &StateVector) -> bool
Check if current update has changes that add new information to a document with given state.
pub fn state_vector(&self) -> StateVector
pub fn state_vector(&self) -> StateVector
Returns a state vector representing an upper bound of client clocks included by blocks stored in current update.
pub fn state_vector_lower(&self) -> StateVector
pub fn state_vector_lower(&self) -> StateVector
Returns a state vector representing a lower bound of items inserted by this update, grouped by their respective clients.
pub fn insertions(&self, include_deleted: bool) -> IdSet
pub fn insertions(&self, include_deleted: bool) -> IdSet
Returns an insertion set associated with current update.
It contains ids of all blocks inserted by this update.
If include_deleted flag is set, result will include GC’ed blocks and ones that were
inserted but softly deleted.
pub fn delete_set(&self) -> &DeleteSet
pub fn delete_set(&self) -> &DeleteSet
Returns a delete set associated with current update.
pub fn merge(&mut self, other: Update)
pub fn merge(&mut self, other: Update)
Merges another update into current one. Their blocks are deduplicated and reordered.
pub fn merge_updates<T>(block_stores: T) -> Updatewhere
T: IntoIterator<Item = Update>,
Trait Implementations§
impl StructuralPartialEq for Update
Auto Trait Implementations§
impl Freeze for Update
impl !RefUnwindSafe for Update
impl !Send for Update
impl !Sync for Update
impl Unpin for Update
impl !UnwindSafe for Update
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> CompatExt for T
impl<T> CompatExt 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§impl<T> Pointable for T
impl<T> Pointable for T
§impl<T> PolicyExt for Twhere
T: ?Sized,
impl<T> PolicyExt for Twhere
T: ?Sized,
§impl<T> ToStringFallible for Twhere
T: Display,
impl<T> ToStringFallible for Twhere
T: Display,
§fn try_to_string(&self) -> Result<String, TryReserveError>
fn try_to_string(&self) -> Result<String, TryReserveError>
ToString::to_string, but without panic on OOM.