pub struct TimezoneField { /* private fields */ }Expand description
A timezone selection field for WiFi provisioning.
Allows users to select their timezone from a dropdown during captive-portal setup. The selected offset (in minutes from UTC) is persisted in memory or flash and can be retrieved later by application code.
See the wifi_auto::fields module example for usage.
Implementations§
Source§impl TimezoneField
impl TimezoneField
Sourcepub const fn new_static() -> TimezoneFieldStatic
pub const fn new_static() -> TimezoneFieldStatic
Create static resources for TimezoneField.
See the wifi_auto::fields module example for usage.
Sourcepub fn new_in_memory(
timezone_field_static: &'static TimezoneFieldStatic,
) -> &'static Self
pub fn new_in_memory( timezone_field_static: &'static TimezoneFieldStatic, ) -> &'static Self
Initialize a timezone field backed by in-memory state.
See the wifi_auto::fields module example for usage.
Sourcepub fn new_with_flash(
timezone_field_static: &'static TimezoneFieldStatic,
timezone_flash_block: FlashBlockEsp,
) -> &'static Self
pub fn new_with_flash( timezone_field_static: &'static TimezoneFieldStatic, timezone_flash_block: FlashBlockEsp, ) -> &'static Self
Initialize a timezone field backed by a flash block.
See the wifi_auto::fields module example for usage.
Sourcepub fn offset_minutes(&self) -> Result<Option<i32>, Error>
pub fn offset_minutes(&self) -> Result<Option<i32>, Error>
Load the stored timezone offset in minutes from UTC.
Returns None if no timezone has been configured yet.
See the wifi_auto::fields module example for usage.
Sourcepub fn set_offset_minutes(&self, offset_minutes: i32) -> Result<(), Error>
pub fn set_offset_minutes(&self, offset_minutes: i32) -> Result<(), Error>
Save a timezone offset in minutes from UTC.
This allows programmatic updates to timezone settings.
For flash-backed fields, this only writes when the value changes to reduce unnecessary flash wear.
See the wifi_auto::fields module example for usage.
Source§impl TimezoneField
impl TimezoneField
Sourcepub fn new(
timezone_field_static: &'static TimezoneFieldStatic,
timezone_flash_block: FlashBlockEsp,
) -> &'static Self
pub fn new( timezone_field_static: &'static TimezoneFieldStatic, timezone_flash_block: FlashBlockEsp, ) -> &'static Self
Initialize a timezone field backed by a flash block.
See the WifiAutoEsp struct example for usage.