Skip to main content

load_or_default

Function load_or_default 

Source
pub fn load_or_default(
    app_name: &str,
    default_width: u32,
    default_height: u32,
) -> WindowState
Expand description

Load persisted window state or return defaults.

This is the primary entry point for window persistence. It attempts to load saved state from the platform-specific config directory. If loading fails (file missing, corrupted, invalid), it returns a default WindowState with the provided dimensions.

ยงArguments

  • app_name - Application identifier used to namespace the config file
  • default_width - Default window width if no saved state exists
  • default_height - Default window height if no saved state exists