pub struct StorageConflictDialog { /* private fields */ }Expand description
Asks how to settle a write the host refused because another client changed the document: keep both versions, reload the stored one or overwrite it. It has no close button and ignores Escape, since the unsaved document waits for a choice; Enter keeps both.
if settings.conflict()
&& let Some(choice) = StorageConflictDialog::new(
"Settings changed elsewhere",
"Another window or device saved the settings while this window had unsaved changes.",
)
.show(ctx)
{
settings.resolve_conflict(choice);
}Implementations§
Source§impl StorageConflictDialog
impl StorageConflictDialog
Sourcepub fn new(title: impl Into<String>, message: impl Into<String>) -> Self
pub fn new(title: impl Into<String>, message: impl Into<String>) -> Self
A dialog titled title that describes the conflict with message, both in English and
translated when shown.
Sourcepub fn show(self, ctx: &Context) -> Option<ConflictChoice>
pub fn show(self, ctx: &Context) -> Option<ConflictChoice>
Shows the dialog; call it every frame while the conflict is unsettled. Returns the user’s choice in the frame it is made.
Auto Trait Implementations§
impl Freeze for StorageConflictDialog
impl RefUnwindSafe for StorageConflictDialog
impl Send for StorageConflictDialog
impl Sync for StorageConflictDialog
impl Unpin for StorageConflictDialog
impl UnsafeUnpin for StorageConflictDialog
impl UnwindSafe for StorageConflictDialog
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> 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 more