pub struct KeyedDiff { /* private fields */ }Expand description
Diff state of a point-keyed display: key -> slot id, free ids, capacity.
Implementations§
Source§impl KeyedDiff
impl KeyedDiff
Sourcepub fn capacity(&self) -> u32
pub fn capacity(&self) -> u32
Max slot id + 1 used so far (including ids taken by an uncommitted PendingDelta).
Sourcepub fn apply(
&mut self,
cloud: &PointCloud,
zones: &[usize],
) -> Result<DisplayDelta, String>
pub fn apply( &mut self, cloud: &PointCloud, zones: &[usize], ) -> Result<DisplayDelta, String>
Diffs cloud (the whole display; unique keys required, zones[i] = owner zone of point i) against the shown state and
commits. Non-finite points are skipped. Errors (no keys, wrong zones length) leave the state untouched.
Sourcepub fn unchanged(&mut self) -> DisplayDelta
pub fn unchanged(&mut self) -> DisplayDelta
A delta that changes nothing (the display is as before); still consumes a sequence number.
Sourcepub fn prepare(
&mut self,
cloud: &PointCloud,
zones: &[usize],
) -> Result<PendingDelta, String>
pub fn prepare( &mut self, cloud: &PointCloud, zones: &[usize], ) -> Result<PendingDelta, String>
Sourcepub fn commit(&mut self, p: PendingDelta) -> DisplayDelta
pub fn commit(&mut self, p: PendingDelta) -> DisplayDelta
Makes a prepared delta the shown state and returns it.
Sourcepub fn abort(&mut self, p: PendingDelta)
pub fn abort(&mut self, p: PendingDelta)
Gives back a prepared delta (its ids return to the free list); the shown state is as before the prepare.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for KeyedDiff
impl RefUnwindSafe for KeyedDiff
impl Send for KeyedDiff
impl Sync for KeyedDiff
impl Unpin for KeyedDiff
impl UnsafeUnpin for KeyedDiff
impl UnwindSafe for KeyedDiff
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
Mutably borrows from an owned value. Read more
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> DistributionExt for Twhere
T: ?Sized,
impl<T> DistributionExt for Twhere
T: ?Sized,
impl<T, U> Imply<T> for U
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> ⓘ
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 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> ⓘ
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 moreSource§impl<T> Pointable for T
impl<T> Pointable for T
impl<T> Read<Exclusive, BecauseExclusive> for Twhere
T: ?Sized,
Source§impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
Source§fn to_subset(&self) -> Option<SS>
fn to_subset(&self) -> Option<SS>
The inverse inclusion map: attempts to construct
self from the equivalent element of its
superset. Read moreSource§fn is_in_subset(&self) -> bool
fn is_in_subset(&self) -> bool
Checks if
self is actually part of its subset T (and can be converted to it).Source§fn to_subset_unchecked(&self) -> SS
fn to_subset_unchecked(&self) -> SS
Use with care! Same as
self.to_subset but without any property checks. Always succeeds.Source§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
The inclusion map: converts
self to the equivalent element of its superset.