pub struct OsWindowState {
pub width: Option<u32>,
pub height: Option<u32>,
pub fullscreen: bool,
pub maximized: bool,
}Expand description
Snapshot of the OS window state — serialisable.
Fields§
§width: Option<u32>Logical width in pixels. None = no saved size (use app default).
height: Option<u32>Logical height in pixels.
fullscreen: boolWindow was borderless-fullscreen.
maximized: boolWindow was maximized (not fullscreen).
Implementations§
Source§impl OsWindowState
impl OsWindowState
Sourcepub fn from_handle(h: &OsWindowHandle) -> Self
pub fn from_handle(h: &OsWindowHandle) -> Self
Read the shared cells of an OsWindowHandle into a snapshot.
Sourcepub fn serialize(&self) -> String
pub fn serialize(&self) -> String
Compact one-line form: width,height,fullscreen,maximized (integers,
comma-separated). Missing dimensions write as 0.
Sourcepub fn deserialize(s: &str) -> Option<Self>
pub fn deserialize(s: &str) -> Option<Self>
Parse the format produced by OsWindowState::serialize. Returns
None on malformed input. Backward-compatible: a 3-field
width,height,fullscreen input (no maximized) parses with
maximized = false.
Trait Implementations§
Source§impl Clone for OsWindowState
impl Clone for OsWindowState
Source§fn clone(&self) -> OsWindowState
fn clone(&self) -> OsWindowState
Returns a duplicate 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 OsWindowState
impl Debug for OsWindowState
Source§impl Default for OsWindowState
impl Default for OsWindowState
Source§fn default() -> OsWindowState
fn default() -> OsWindowState
Returns the “default value” for a type. Read more
Source§impl PartialEq for OsWindowState
impl PartialEq for OsWindowState
impl Copy for OsWindowState
impl Eq for OsWindowState
impl StructuralPartialEq for OsWindowState
Auto Trait Implementations§
impl Freeze for OsWindowState
impl RefUnwindSafe for OsWindowState
impl Send for OsWindowState
impl Sync for OsWindowState
impl Unpin for OsWindowState
impl UnsafeUnpin for OsWindowState
impl UnwindSafe for OsWindowState
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> 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 moreSource§impl<T> Pointable for T
impl<T> Pointable for T
Source§impl<R, P> ReadPrimitive<R> for P
impl<R, P> ReadPrimitive<R> for P
Source§fn read_from_little_endian(read: &mut R) -> Result<Self, Error>
fn read_from_little_endian(read: &mut R) -> Result<Self, Error>
Read this value from the supplied reader. Same as
ReadEndian::read_from_little_endian().