Enum zng_wgt_window::SaveState
source · pub enum SaveState {
Enabled {
key: Option<ConfigKey>,
loading_timeout: Duration,
},
Disabled,
}
Expand description
Window persistence config.
See the save_state
property for more details.
Variants§
Enabled
Save and restore state.
Fields
§
key: Option<ConfigKey>
Config key that identifies the window.
If None
a key is generated for the window, using the window_key
method.
Disabled
Don’t save nor restore state.
Implementations§
source§impl SaveState
impl SaveState
sourcepub fn window_key(&self, id: WindowId) -> Option<ConfigKey>
pub fn window_key(&self, id: WindowId) -> Option<ConfigKey>
Gets the config key used for the window identified by id
.
sourcepub fn loading_timeout(&self) -> Option<Duration>
pub fn loading_timeout(&self) -> Option<Duration>
Get the loading timeout if it is enabled and the duration is greater than zero.
sourcepub fn is_enabled(&self) -> bool
pub fn is_enabled(&self) -> bool
Returns true
if it is enabled.
Trait Implementations§
source§impl<'de> Deserialize<'de> for SaveState
impl<'de> Deserialize<'de> for SaveState
source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
source§impl PartialEq for SaveState
impl PartialEq for SaveState
impl IntoValue<SaveState> for bool
impl StructuralPartialEq for SaveState
Auto Trait Implementations§
impl Freeze for SaveState
impl RefUnwindSafe for SaveState
impl Send for SaveState
impl Sync for SaveState
impl Unpin for SaveState
impl UnwindSafe for SaveState
Blanket Implementations§
source§impl<T> AnyVarValue for Twhere
T: VarValue,
impl<T> AnyVarValue for Twhere
T: VarValue,
source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
Access to mut
dyn Any
methods.source§fn clone_boxed(&self) -> Box<dyn AnyVarValue>
fn clone_boxed(&self) -> Box<dyn AnyVarValue>
Clone the value.
source§fn clone_boxed_var(&self) -> Box<dyn AnyVar>
fn clone_boxed_var(&self) -> Box<dyn AnyVar>
Clone the value into a new boxed
LocalVar<Self>
.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> FsChangeNote for T
impl<T> FsChangeNote for T
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