pub struct WatchOptions {
pub interest: Option<Status>,
pub wake_on: Option<Status>,
pub max_interval: Option<i64>,
pub wake_on_max_interval: Option<bool>,
/* private fields */
}Expand description
Configuration options for charger state watching.
interest and wake_on are optional masks: the actual field values within the Status table
are ignored; only field presence (set vs. unset) determines the mask.
An absent mask means “use this field’s default”; a present but empty mask means “no fields”.
The two defaults differ because the safe choice differs: interest defaults to everything the
driver supports watching, so a client that never configures anything still makes progress,
while wake_on defaults to nothing, since waking the system is a cost a client must opt into.
Fields§
§interest: Option<Status>Fields the client wants to receive change notifications for.
Defaults to every field the driver supports watching, as reported by
Spec.supported_options. Pass an explicitly empty table to be notified only for the
fields named in wake_on.
wake_on: Option<Status>Fields that should actively wake the system from suspend.
Any field present in wake_on is implicitly included in interest.
Defaults to no fields: changes occurring during suspend are deferred until the next system
wakeup and do not wake the device.
max_interval: Option<i64>Maximum time between Watch responses. When set, the server completes a pending Watch
with a freshly sampled Status once this much time has passed since the previous response,
even if no field in interest changed.
The time is measured on the boot timeline, so time spent suspended counts towards it.
Defaults to absent: Watch only completes on changes.
Servers that do not support periodic sampling omit this field from the effective options
returned by ConfigureWatch and from Spec.supported_options. Servers may clamp the value,
and report the interval they will honor in the effective options.
Samples do not wake the system from suspend unless wake_on_max_interval is set: a sample
that falls due while the system is suspended is taken once the system resumes.
wake_on_max_interval: Option<bool>Whether a max_interval sample that falls due while the system is suspended wakes the
system. Defaults to false; like wake_on, waking the system is a cost the client opts into.
Ignored if max_interval is absent.
Servers that cannot wake the system omit this field from the effective options returned by
ConfigureWatch and from Spec.supported_options.
Trait Implementations§
Source§impl Clone for WatchOptions
impl Clone for WatchOptions
Source§fn clone(&self) -> WatchOptions
fn clone(&self) -> WatchOptions
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for WatchOptions
impl Debug for WatchOptions
Source§impl<D> Decode<WatchOptions, D> for WatchOptionswhere
D: ResourceDialect,
impl<D> Decode<WatchOptions, D> for WatchOptionswhere
D: ResourceDialect,
Source§fn new_empty() -> WatchOptions
fn new_empty() -> WatchOptions
Self. The specific value does not matter,
since it will be overwritten by decode.Source§impl Default for WatchOptions
impl Default for WatchOptions
Source§fn default() -> WatchOptions
fn default() -> WatchOptions
Source§impl<D> Encode<WatchOptions, D> for &WatchOptionswhere
D: ResourceDialect,
impl<D> Encode<WatchOptions, D> for &WatchOptionswhere
D: ResourceDialect,
Source§impl PartialEq for WatchOptions
impl PartialEq for WatchOptions
impl Persistable for WatchOptions
impl StructuralPartialEq for WatchOptions
Source§impl TypeMarker for WatchOptions
impl TypeMarker for WatchOptions
Source§type Owned = WatchOptions
type Owned = WatchOptions
Source§fn inline_align(_context: Context) -> usize
fn inline_align(_context: Context) -> usize
Source§fn inline_size(_context: Context) -> usize
fn inline_size(_context: Context) -> usize
inline_align.Source§fn encode_is_copy() -> bool
fn encode_is_copy() -> bool
Self::Owned matches the FIDL wire
format and encoding requires no validation. When true, we can optimize
encoding arrays and vectors of Self::Owned to a single memcpy. Read moreSource§fn decode_is_copy() -> bool
fn decode_is_copy() -> bool
Self::Owned matches the FIDL wire
format and decoding requires no validation. When true, we can optimize
decoding arrays and vectors of Self::Owned to a single memcpy.Source§impl ValueTypeMarker for WatchOptions
impl ValueTypeMarker for WatchOptions
Source§type Borrowed<'a> = &'a WatchOptions
type Borrowed<'a> = &'a WatchOptions
Encode<Self>
type cheaply obtainable from &Self::Owned. There are three cases: Read moreSource§fn borrow(
value: &<WatchOptions as TypeMarker>::Owned,
) -> <WatchOptions as ValueTypeMarker>::Borrowed<'_>
fn borrow( value: &<WatchOptions as TypeMarker>::Owned, ) -> <WatchOptions as ValueTypeMarker>::Borrowed<'_>
&Self::Owned to Self::Borrowed.