pub struct WindowSnapshot {
pub window_id: String,
pub inner_size: Option<LogicalWindowSize>,
pub maximized: bool,
pub fullscreen: bool,
pub position: Option<LogicalWindowPosition>,
}Expand description
Restorable state for one logical top-level window.
The identifier may be empty and is not normalized. None size/position
means that geometry was not saved and the platform should choose it.
§Examples
use ailloli_ui_app_storage::WindowSnapshot;
let snapshot = WindowSnapshot::new("main");
assert_eq!(snapshot.inner_size, None);
assert!(!snapshot.maximized && !snapshot.fullscreen);Fields§
§window_id: StringConsumer-defined logical window identifier, matched exactly.
inner_size: Option<LogicalWindowSize>Saved inner content size in logical pixels, or None to use platform defaults.
maximized: boolWhether the window should be restored maximized.
fullscreen: boolWhether the window should be restored fullscreen.
position: Option<LogicalWindowPosition>Saved logical desktop position, or None to let the platform place it.
Implementations§
Source§impl WindowSnapshot
impl WindowSnapshot
Sourcepub fn new(window_id: impl Into<String>) -> Self
pub fn new(window_id: impl Into<String>) -> Self
Creates a normally positioned snapshot with no saved geometry.
window_id is stored verbatim, including an empty string.
§Examples
use ailloli_ui_app_storage::WindowSnapshot;
let snapshot = WindowSnapshot::new("main");
assert_eq!(snapshot.window_id, "main");
assert_eq!(snapshot.position, None);Trait Implementations§
Source§impl Clone for WindowSnapshot
impl Clone for WindowSnapshot
Source§fn clone(&self) -> WindowSnapshot
fn clone(&self) -> WindowSnapshot
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 Debug for WindowSnapshot
impl Debug for WindowSnapshot
Source§impl<'de> Deserialize<'de> for WindowSnapshot
impl<'de> Deserialize<'de> for WindowSnapshot
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 WindowSnapshot
impl PartialEq for WindowSnapshot
Source§impl Serialize for WindowSnapshot
impl Serialize for WindowSnapshot
impl StructuralPartialEq for WindowSnapshot
Auto Trait Implementations§
impl Freeze for WindowSnapshot
impl RefUnwindSafe for WindowSnapshot
impl Send for WindowSnapshot
impl Sync for WindowSnapshot
impl Unpin for WindowSnapshot
impl UnwindSafe for WindowSnapshot
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