#[non_exhaustive]pub enum DrawingSyncAction {
SaveDrawing(usize),
UpdateDrawing(usize),
Delete(String),
RestoreDrawings(Vec<StoredDrawing>),
}Expand description
A change to the stored drawings, queued in DrawingManager::pending_sync.
When enabled, every DrawingManager method that changes a stored drawing field queues
an action per drawing it changes: creating, moving, styling, locking, hiding, layering,
deleting, undo and redo. Restoring a stored drawing with
DrawingManager::add_synced_drawing queues nothing. Repeated saves and updates coalesce
until that drawing is deleted. The host drains the queue and saves or deletes each drawing it names,
skipping saves of drawings already deleted, for example with
drawing_to_stored. A host that writes
to DrawingManager::drawings directly queues nothing. Automatic chart storage disables
these notifications; use DrawingManager::set_sync_enabled to consume both paths.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
SaveDrawing(usize)
A new drawing was created and should be saved. Carries the drawing ID.
UpdateDrawing(usize)
An existing drawing was modified (moved, resized, styled). Carries the drawing ID.
Delete(String)
A drawing was deleted. Carries the stored drawing ID as a string.
RestoreDrawings(Vec<StoredDrawing>)
A batch of drawings should be restored from backend storage. The manager never queues it.
Trait Implementations§
Source§impl Clone for DrawingSyncAction
impl Clone for DrawingSyncAction
Source§fn clone(&self) -> DrawingSyncAction
fn clone(&self) -> DrawingSyncAction
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreAuto Trait Implementations§
impl Freeze for DrawingSyncAction
impl RefUnwindSafe for DrawingSyncAction
impl Send for DrawingSyncAction
impl Sync for DrawingSyncAction
impl Unpin for DrawingSyncAction
impl UnsafeUnpin for DrawingSyncAction
impl UnwindSafe for DrawingSyncAction
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<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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