Skip to main content

ActivityKitBackend

Struct ActivityKitBackend 

Source
pub struct ActivityKitBackend { /* private fields */ }
Available on crate feature app only.
Expand description

The default iOS backend: the activitykit crate, which links its own Swift bridge.

Progress and timer templates become layout activities with a fixed tree; layouts are activitykit’s own. The Swift layer answers from the main thread, so do not block the main thread on a call. Off iOS the backend compiles, reports no capability and answers UNSUPPORTED_PLATFORM.

Implementations§

Source§

impl ActivityKitBackend

Source

pub fn new() -> Self

The backend on activitykit’s default settings.

Source

pub fn with_kit(kit: ActivityKit) -> Self

The backend on a kit that the caller built, for example with redacted receipts or the push-to-start watch: ActivityKit::builder().receipts(..).push_to_start(true).build()?.

Trait Implementations§

Source§

impl Default for ActivityKitBackend

Source§

fn default() -> Self

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

impl LiveActivityBackend for ActivityKitBackend

Source§

fn attach(&self, events: BackendContext) -> Result<()>

Starts the thread that forwards events. Elsewhere than on a device with Live Activities activitykit reports no event, so no thread waits for one.

Source§

fn capabilities(&self) -> BackendFuture<'_, Capabilities>

What the backend can do on this device.
Source§

fn permissions(&self) -> BackendFuture<'_, Permissions>

The operating system’s permissions.
Source§

fn request_permissions( &self, kind: PermissionKind, ) -> BackendFuture<'_, Permissions>

Asks the operating system for a permission. The default cannot ask.
Source§

fn start(&self, input: StartInput) -> BackendFuture<'_, ActivityRecord>

Starts a progress or timer activity.
Source§

fn update(&self, input: UpdateInput) -> BackendFuture<'_, ActivityRecord>

Replaces the content of a progress or timer activity.
Source§

fn end(&self, input: EndInput) -> BackendFuture<'_, ActivityRecord>

Ends a progress or timer activity.
Source§

fn list(&self) -> BackendFuture<'_, Vec<ActivityRecord>>

The progress and timer activities the backend knows.
Source§

fn start_layout( &self, input: LayoutStartInput, ) -> BackendFuture<'_, LayoutActivityRecord>

Starts a layout activity. The default draws no layouts.
Source§

fn update_layout( &self, input: LayoutUpdateInput, ) -> BackendFuture<'_, LayoutActivityRecord>

Replaces the values of a layout activity. The default draws no layouts.
Source§

fn end_layout( &self, input: LayoutEndInput, ) -> BackendFuture<'_, LayoutActivityRecord>

Ends a layout activity. The default draws no layouts.
Source§

fn list_layout(&self) -> BackendFuture<'_, Vec<LayoutActivityRecord>>

The layout activities the backend knows. The default has none.
Source§

fn write_image(&self, name: String, png: Vec<u8>) -> BackendFuture<'_, ()>

Stores a checked PNG under name for image nodes that name it. The default stores none.
Source§

fn push_tokens(&self) -> BackendFuture<'_, PushTokens>

The push tokens the backend holds since launch. The default has no pushes and holds none.
Source§

fn sync_events(&self) -> BackendFuture<'_, ()>

Sends the taps the platform queued to the event sink. A platform that calls back needs nothing here, which is the default.
Source§

fn open_promotion_settings(&self) -> BackendFuture<'_, ()>

Asks the system for the screen where a person allows or stops the application’s Live Updates. The default has none; a backend that wraps another forwards it.

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
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> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

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

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

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> PolicyExt for T
where T: ?Sized,

Source§

fn and<P, B, E>(self, other: P) -> And<T, P>
where T: Sized + 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
Source§

fn or<P, B, E>(self, other: P) -> Or<T, P>
where T: Sized + 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, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

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

fn try_from(value: U) -> Result<T, !>

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.
Source§

impl<T> WithSubscriber for T

Source§

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
Source§

fn with_current_subscriber(self) -> WithDispatch<Self> ⓘ

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