Skip to main content

Summary

Struct Summary 

pub struct Summary {
Show 14 fields pub id: String, pub kind: Kind, pub title: String, pub subtitle: String, pub icon: String, pub source: String, pub value: String, pub countdown: Option<i64>, pub progress: Option<f32>, pub length: Option<u64>, pub artwork: String, pub art: Art, pub tone: Tone, pub controls: Vec<Control>,
}
Expand description

One activity, as the bar’s pill and the floating layer draw it.

Fields§

§id: String

The activity’s own id, stable while it runs: the same timer or call keeps its id across frames, so a card keeps its place and its dismissal.

§kind: Kind§title: String

What it is, in the app’s words: “Tea”, “Ada”, “9th Street”.

§subtitle: String

The line under it: the artist of a song, who is speaking, the street the directions turn onto.

§icon: String

The app’s own glyph, by lucide name (“timer”, “music”): a card’s header shows it, so a glance says which app the activity is.

§source: String

The app the activity belongs to, as the person knows it (“Music”, “Clocks”): a card’s header says it beside the app’s glyph. The session that shows the activity fills it, so it is named in the person’s language and never as an id.

§value: String

What it reads now: “4:32”, “2 min”, “muted”.

§countdown: Option<i64>

What is left, in seconds, for a countdown: a timer due sooner stands ahead of one that is not.

§progress: Option<f32>

How far along it is, from 0 to 1, when it has a length.

§length: Option<u64>

How long what it plays runs, in seconds: with progress, a card says where the song is and what is left of it.

§artwork: String

Its artwork, by picture address (a content address, or a data: picture): a card shows it beside the title, the pill’s a thumbnail.

§art: Art

How the artwork heads the card: beside the lines, or over them.

§tone: Tone§controls: Vec<Control>

Implementations§

§

impl Summary

pub fn new( kind: Kind, title: impl Into<String>, value: impl Into<String>, ) -> Summary

An activity of kind called title, reading value.

pub fn with_subtitle(self, subtitle: impl Into<String>) -> Summary

The line under the title: the artist, the speaker, the street.

pub fn with_icon(self, icon: impl Into<String>) -> Summary

The app’s own glyph, by lucide name.

pub fn with_source(self, source: impl Into<String>) -> Summary

The app it belongs to, as the person knows it: a card’s header says it beside the app’s glyph.

pub fn glyph(&self) -> &str

The glyph a card’s header shows: the app’s own, or the one its kind stands for.

pub fn with_id(self, id: impl Into<String>) -> Summary

pub fn with_countdown(self, seconds: i64) -> Summary

pub fn with_progress(self, progress: f32) -> Summary

pub fn with_length(self, seconds: u64) -> Summary

How long it runs, in seconds, so a card can say where it is and what is left of it.

pub fn with_artwork(self, artwork: impl Into<String>) -> Summary

The artwork it shows, by picture address.

pub fn with_hero_artwork(self, artwork: impl Into<String>) -> Summary

The artwork heads the card over its lines, at nine sixteenths of the card’s width: a picture the activity made is shown whole, not as a tile beside a title.

pub fn elapsed_seconds(&self) -> Option<u64>

Where the activity stands in what it runs, in seconds, from how far along it is: None when it has no length.

pub fn remaining_seconds(&self) -> Option<u64>

What is left of it, in seconds, when it has a length.

pub fn with_tone(self, tone: Tone) -> Summary

pub fn with_control(self, control: Control) -> Summary

pub fn reading(&self) -> String

The words the pill and a card’s header say: the title, and its reading when it has one.

pub fn hero(&self) -> &str

What a card shows largest: the reading when it has one, else the title. A timer’s countdown is what a glance is after; a song has no countdown, and its track is.

pub fn header_title(&self) -> Option<&str>

The title a card’s header says above its hero, when the hero is not the title itself.

pub fn header_line(&self) -> &str

What a card’s header says beside the app’s glyph: the title, when the hero is the card’s reading, else the app the activity belongs to.

pub fn pill_rank(&self) -> (u8, i64, &str)

Where this activity stands in the pill: its kind first, then a timer that is due within a minute, then what it has left, then its id, so the order never depends on the order the board was read in.

pub fn first_control(&self) -> Option<&Control>

The control a plain press (Space, a click on the card) runs: the first one the app marked primary, else its first.

pub fn close_control(&self) -> Option<&Control>

The control that ends the activity, when the app offers one.

pub fn has_actions(&self) -> bool

Whether the card draws a row of offered controls: every control but the close, which its header carries instead.

pub fn action_controls(&self) -> Vec<&Control>

The controls the card’s row draws, in the order the app named them: everything but the close, which the card’s header carries instead.

pub fn transport(&self) -> Option<Vec<(&str, TransportControl)>>

The activity’s offered controls as a media transport, when every one of them is the transport’s — previous, play/pause, next: the card then paints them the one way every media surface paints a transport, by id.

Trait Implementations§

§

impl Clone for Summary

§

fn clone(&self) -> Summary

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
§

impl Debug for Summary

§

fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>

Formats the value using the given formatter. Read more
§

impl Default for Summary

§

fn default() -> Summary

Returns the “default value” for a type. Read more
§

impl<'de> Deserialize<'de> for Summary

§

fn deserialize<__D>( __deserializer: __D, ) -> Result<Summary, <__D as Deserializer<'de>>::Error>
where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
§

impl PartialEq for Summary

§

fn eq(&self, other: &Summary) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
§

impl Serialize for Summary

§

fn serialize<__S>( &self, __serializer: __S, ) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more
§

impl StructuralPartialEq for Summary

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<T> AnyEq for T
where T: Any + PartialEq,

§

fn equals(&self, other: &(dyn Any + 'static)) -> bool

§

fn as_any(&self) -> &(dyn Any + 'static)

§

impl<T> AsAny for T
where T: 'static,

§

fn as_any(&self) -> &(dyn Any + 'static)

Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
§

impl<T> Downcast<T> for T

§

fn downcast(&self) -> &T

§

impl<T> Downcast for T
where T: Any,

§

fn into_any(self: Box<T>) -> Box<dyn Any>

Convert Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can then be further downcast into Box<ConcreteType> where ConcreteType implements Trait.
§

fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>

Convert Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be further downcast into Rc<ConcreteType> where ConcreteType implements Trait.
§

fn as_any(&self) -> &(dyn Any + 'static)

Convert &Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot generate &Any’s vtable from &Trait’s.
§

fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)

Convert &mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot generate &mut Any’s vtable from &mut Trait’s.
§

impl<T> Downcast for T
where T: Any,

§

fn into_any(self: Box<T>) -> Box<dyn Any>

Converts Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>, which can then be downcast into Box<dyn ConcreteType> where ConcreteType implements Trait.
§

fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>

Converts Rc<Trait> (where Trait: Downcast) to Rc<Any>, which can then be further downcast into Rc<ConcreteType> where ConcreteType implements Trait.
§

fn as_any(&self) -> &(dyn Any + 'static)

Converts &Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot generate &Any’s vtable from &Trait’s.
§

fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)

Converts &mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot generate &mut Any’s vtable from &mut Trait’s.
§

impl<T> DowncastSend for T
where T: Any + Send,

§

fn into_any_send(self: Box<T>) -> Box<dyn Any + Send>

Converts Box<Trait> (where Trait: DowncastSend) to Box<dyn Any + Send>, which can then be downcast into Box<ConcreteType> where ConcreteType implements Trait.
§

impl<T> DowncastSync for T
where T: Any + Send + Sync,

§

fn into_any_arc(self: Arc<T>) -> Arc<dyn Any + Send + Sync> ⓘ

Convert Arc<Trait> (where Trait: Downcast) to Arc<Any>. Arc<Any> can then be further downcast into Arc<ConcreteType> where ConcreteType implements Trait.
§

impl<T> DowncastSync for T
where T: Any + Send + Sync,

§

fn into_any_sync(self: Box<T>) -> Box<dyn Any + Send + Sync>

Converts Box<Trait> (where Trait: DowncastSync) to Box<dyn Any + Send + Sync>, which can then be downcast into Box<ConcreteType> where ConcreteType implements Trait.
§

fn into_any_arc(self: Arc<T>) -> Arc<dyn Any + Send + Sync> ⓘ

Converts Arc<Trait> (where Trait: DowncastSync) to Arc<Any>, which can then be downcast into Arc<ConcreteType> where ConcreteType implements Trait.
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

§

impl<T> Instrument for T

§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided [Span], returning an Instrumented wrapper. Read more
§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self>

Converts self into a Left variant of Either<Self, Self> if into_left is true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

Converts self into a Left variant of Either<Self, Self> if into_left(&self) returns true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
§

impl<T> NoneValue for T
where T: Default,

§

type NoneType = T

§

fn null_value() -> T

The none-equivalent value.
§

impl<T> Pointable for T

§

const ALIGN: usize

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
§

impl<T> PolicyExt for T
where T: ?Sized,

§

fn and<P, B, E>(self, other: P) -> And<T, P>
where T: Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns [Action::Follow] only if self and other return Action::Follow. Read more
§

fn or<P, B, E>(self, other: P) -> Or<T, P>
where T: Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns [Action::Follow] if either self or other returns Action::Follow. Read more
Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> Serialize for T
where T: Serialize + ?Sized,

Source§

fn erased_serialize(&self, serializer: &mut dyn Serializer) -> Result<(), Error>

Source§

fn do_erased_serialize( &self, serializer: &mut dyn Serializer, ) -> Result<(), ErrorImpl>

§

impl<T, S> SimdFrom<T, S> for T
where S: Simd,

§

fn simd_from(_simd: S, value: T) -> T

§

impl<F, T, S> SimdInto<T, S> for F
where T: SimdFrom<F, S>, S: Simd,

§

fn simd_into(self, simd: S) -> T

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<T> Upcast<T> for T

§

fn upcast(&self) -> Option<&T>

§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> WithSubscriber for T

§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a [WithDispatch] wrapper. Read more
§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a [WithDispatch] wrapper. Read more
§

impl<T> CommonTraits for T
where T: AsAny + Any + Debug + WasmNotSendSync,

Source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,

§

impl<T> ErasedDestructor for T
where T: 'static,

§

impl<T> Fruit for T
where T: Send + Downcast,

§

impl<T> MaybeSendSync for T
where T: Send + Sync + ?Sized,

§

impl<T> WasmNotSend for T
where T: Send,

§

impl<T> WasmNotSendSync for T

§

impl<T> WasmNotSync for T
where T: Sync,