pub struct DraftSettings {
pub current: Settings,
/* private fields */
}Fields§
§current: SettingsImplementations§
Source§impl DraftSettings
impl DraftSettings
pub fn from_settings(s: Settings) -> Self
Sourcepub fn is_dirty(&self) -> bool
pub fn is_dirty(&self) -> bool
True if the current draft differs from the on-disk snapshot.
Comparison is via YAML serialization to avoid implementing PartialEq on the entire Settings tree (and to ignore non-semantic differences like HashMap iteration order).
Sourcepub fn pin_original(&mut self, s: Settings)
pub fn pin_original(&mut self, s: Settings)
After a successful save, pin the new content as the original so
is_dirty() returns false again.
Trait Implementations§
Source§impl Clone for DraftSettings
impl Clone for DraftSettings
Auto Trait Implementations§
impl Forget for DraftSettings
impl Freeze for DraftSettings
impl Move for DraftSettings
impl RefUnwindSafe for DraftSettings
impl Send for DraftSettings
impl Sync for DraftSettings
impl Unpin for DraftSettings
impl UnsafeUnpin for DraftSettings
impl UnwindSafe for DraftSettings
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<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