pub struct StartInput {
pub activity_key: String,
pub schema_version: u8,
pub template: Template,
pub fallback: Fallback,
pub snapshot: Snapshot,
}Expand description
The input of start: a progress or timer activity.
Fields§
§activity_key: StringThe application’s own name of the activity: a running activity with the same key and request is the same activity.
schema_version: u8The version of the request contract: 1 for a template, 2 for a layout.
template: TemplateThe template, fixed at start.
fallback: FallbackWhat to do when the platform cannot give the activity its native presentation.
snapshot: SnapshotThe content, with its revision.
Implementations§
Source§impl StartInput
impl StartInput
Sourcepub fn stale(self, at: u64) -> Self
pub fn stale(self, at: u64) -> Self
The same start with content that is shown as out of date from at, in epoch milliseconds.
Sourcepub fn new(activity_key: impl Into<String>, snapshot: Snapshot) -> Self
pub fn new(activity_key: impl Into<String>, snapshot: Snapshot) -> Self
A start that shows snapshot under the application’s own activity_key, with the template that the
snapshot is of: the timer’s when it has a timer, the progress’s otherwise. As the two constructors below
it falls back to an ordinary notification.
Sourcepub fn progress(
activity_key: &str,
title: &str,
status: &str,
progress: f64,
) -> Self
pub fn progress( activity_key: &str, title: &str, status: &str, progress: f64, ) -> Self
A progress activity under the application’s own activity_key, with progress from 0 to 1.
Sourcepub fn timer(
activity_key: &str,
title: &str,
status: &str,
started_at: u64,
ends_at: u64,
) -> Self
pub fn timer( activity_key: &str, title: &str, status: &str, started_at: u64, ends_at: u64, ) -> Self
A countdown from started_at to ends_at, in epoch milliseconds.
Sourcepub fn without_fallback(self) -> Self
pub fn without_fallback(self) -> Self
The same start, failing with UNSUPPORTED_FEATURE where the platform cannot give the activity its native
presentation, instead of showing an ordinary notification.