Skip to main content

UpdatesBuilder

Struct UpdatesBuilder 

Source
pub struct UpdatesBuilder<U: Update> { /* private fields */ }
Expand description

An incremental trie builder that accepts sorted, consolidated UpdatesTyped chunks and melds them into a single UpdatesTyped trie.

The internal UpdatesTyped has open (unsealed) bounds at the keys, vals, and times levels — the last group at each level has its values pushed but no corresponding bounds entry. diffs.bounds is always 1:1 with times.values.

meld accepts a consolidated UpdatesTyped whose first (key, val, time) is strictly greater than the builder’s last (key, val, time). The key and val may equal the builder’s current open key/val, as long as the time is greater.

done seals all open bounds and returns the completed UpdatesTyped.

Implementations§

Source§

impl<U: Update> UpdatesBuilder<U>

Source

pub fn new_from(updates: UpdatesTyped<U>) -> Self

Construct a new builder from consolidated, sealed updates.

Unseals the last group at keys, vals, and times levels so that subsequent meld calls can extend the open groups. If the updates are not consolidated none of this works.

Source

pub fn meld(&mut self, chunk: &UpdatesTyped<U>)

Meld a sorted, consolidated UpdatesTyped chunk into this builder.

The chunk’s first (key, val, time) must be strictly greater than the builder’s last (key, val, time). Keys and vals may overlap (continue the current group), but times must be strictly increasing within the same (key, val).

Source

pub fn done(self) -> UpdatesTyped<U>

Seal all open bounds and return the completed UpdatesTyped.

Auto Trait Implementations§

§

impl<U> Freeze for UpdatesBuilder<U>

§

impl<U> RefUnwindSafe for UpdatesBuilder<U>

§

impl<U> Send for UpdatesBuilder<U>

§

impl<U> Sync for UpdatesBuilder<U>

§

impl<U> Unpin for UpdatesBuilder<U>

§

impl<U> UnsafeUnpin for UpdatesBuilder<U>

§

impl<U> UnwindSafe for UpdatesBuilder<U>

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> IntoEither for T

Source§

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 more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

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
Source§

impl<'a, S, T> Semigroup<&'a S> for T
where T: Semigroup<S>,

Source§

fn plus_equals(&mut self, rhs: &&'a S)

The method of std::ops::AddAssign, for types that do not implement AddAssign.
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.