pub struct ScreenTimeState {
pub date: String,
pub seconds: u64,
pub last_reminder_epoch_secs: Option<u64>,
}Expand description
Cumulative active-screen time for the current local day, plus the epoch of the most recent wind-down reminder (so we don’t re-nag every tick after the budget is crossed).
Fields§
§date: String§seconds: u64§last_reminder_epoch_secs: Option<u64>Implementations§
Source§impl ScreenTimeState
impl ScreenTimeState
Sourcepub fn from_snapshot(snap: ScreenTimeSnapshot, today: &str) -> Self
pub fn from_snapshot(snap: ScreenTimeSnapshot, today: &str) -> Self
Build state from a persisted snapshot. If the snapshot is from a previous day, the counter resets — we don’t carry yesterday’s usage into today.
Sourcepub fn to_snapshot(&self) -> ScreenTimeSnapshot
pub fn to_snapshot(&self) -> ScreenTimeSnapshot
Convert this state into the on-disk wire format. The inverse of
from_snapshot.
Trait Implementations§
Source§impl Clone for ScreenTimeState
impl Clone for ScreenTimeState
Source§fn clone(&self) -> ScreenTimeState
fn clone(&self) -> ScreenTimeState
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 ScreenTimeState
impl Debug for ScreenTimeState
Source§impl Default for ScreenTimeState
impl Default for ScreenTimeState
Source§fn default() -> ScreenTimeState
fn default() -> ScreenTimeState
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for ScreenTimeState
impl RefUnwindSafe for ScreenTimeState
impl Send for ScreenTimeState
impl Sync for ScreenTimeState
impl Unpin for ScreenTimeState
impl UnsafeUnpin for ScreenTimeState
impl UnwindSafe for ScreenTimeState
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,
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
§impl<T> NoneValue for Twhere
T: Default,
impl<T> NoneValue for Twhere
T: Default,
type NoneType = T
§fn null_value() -> T
fn null_value() -> T
The none-equivalent value.