pub enum ItemAction<I: Item> {
SaveToStatus {
a: ItemRef,
b: ItemRef,
uid: String,
hash: ItemHash,
},
UpdateStatus {
hash: ItemHash,
old: (ItemRef, ItemRef),
new: (ItemRef, ItemRef),
},
ClearStatus {
uid: String,
},
Create {
side: Side,
source: ItemState<I>,
},
Update {
side: Side,
source: ItemState<I>,
target: ItemRef,
old: (ItemRef, ItemRef),
},
Delete {
side: Side,
target: ItemRef,
uid: String,
},
Conflict {
a: ItemState<I>,
b: ItemState<I>,
old: Option<(ItemRef, ItemRef)>,
},
}Expand description
Operation to execute on an item during synchronising.
These actions contain all data necessary to execute them and update the status database. They
only lack a MappingUid, since this may be resolved at execution time (e.g.: if the
collection does not exist).
Variants§
SaveToStatus
Item is new and identical on both sides.
UpdateStatus
Update the status DB.
Item has changed on both sides, but remains in sync. The old field contains data to
update the status db atomically.
ClearStatus
Item is gone from both sides but still present in status db.
Create
Update
Update an item with data from the other side.
The old field contains data to update the status db atomically.
Delete
Conflict
Item is in conflict which needs to be resolved externally.
Implementations§
Trait Implementations§
Source§impl<I: Clone + Item> Clone for ItemAction<I>
impl<I: Clone + Item> Clone for ItemAction<I>
Source§fn clone(&self) -> ItemAction<I>
fn clone(&self) -> ItemAction<I>
Returns a copy of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl<I: Item> Display for ItemAction<I>
impl<I: Item> Display for ItemAction<I>
impl<I: Item> StructuralPartialEq for ItemAction<I>
Auto Trait Implementations§
impl<I> Freeze for ItemAction<I>where
I: Freeze,
impl<I> RefUnwindSafe for ItemAction<I>where
I: RefUnwindSafe,
impl<I> Send for ItemAction<I>
impl<I> Sync for ItemAction<I>
impl<I> Unpin for ItemAction<I>where
I: Unpin,
impl<I> UnwindSafe for ItemAction<I>where
I: UnwindSafe,
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<Source, Target> OctetsInto<Target> for Sourcewhere
Target: OctetsFrom<Source>,
impl<Source, Target> OctetsInto<Target> for Sourcewhere
Target: OctetsFrom<Source>,
type Error = <Target as OctetsFrom<Source>>::Error
Source§fn try_octets_into(
self,
) -> Result<Target, <Source as OctetsInto<Target>>::Error>
fn try_octets_into( self, ) -> Result<Target, <Source as OctetsInto<Target>>::Error>
Performs the conversion.
Source§fn octets_into(self) -> Target
fn octets_into(self) -> Target
Performs an infallible conversion.