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
impl ActivityKitBackend
Sourcepub fn with_kit(kit: ActivityKit) -> Self
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
impl Default for ActivityKitBackend
Source§impl LiveActivityBackend for ActivityKitBackend
impl LiveActivityBackend for ActivityKitBackend
Source§fn attach(&self, events: BackendContext) -> Result<()>
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>
fn capabilities(&self) -> BackendFuture<'_, Capabilities>
What the backend can do on this device.
Source§fn permissions(&self) -> BackendFuture<'_, Permissions>
fn permissions(&self) -> BackendFuture<'_, Permissions>
The operating system’s permissions.
Source§fn request_permissions(
&self,
kind: PermissionKind,
) -> BackendFuture<'_, Permissions>
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>
fn start(&self, input: StartInput) -> BackendFuture<'_, ActivityRecord>
Starts a progress or timer activity.
Source§fn update(&self, input: UpdateInput) -> BackendFuture<'_, ActivityRecord>
fn update(&self, input: UpdateInput) -> BackendFuture<'_, ActivityRecord>
Replaces the content of a progress or timer activity.
Source§fn end(&self, input: EndInput) -> BackendFuture<'_, ActivityRecord>
fn end(&self, input: EndInput) -> BackendFuture<'_, ActivityRecord>
Ends a progress or timer activity.
Source§fn list(&self) -> BackendFuture<'_, Vec<ActivityRecord>>
fn list(&self) -> BackendFuture<'_, Vec<ActivityRecord>>
The progress and timer activities the backend knows.
Source§fn start_layout(
&self,
input: LayoutStartInput,
) -> BackendFuture<'_, LayoutActivityRecord>
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>
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>
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>>
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<'_, ()>
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>
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<'_, ()>
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<'_, ()>
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§
impl !Freeze for ActivityKitBackend
impl !RefUnwindSafe for ActivityKitBackend
impl !UnwindSafe for ActivityKitBackend
impl Forget for ActivityKitBackend
impl Move for ActivityKitBackend
impl Send for ActivityKitBackend
impl Sync for ActivityKitBackend
impl Unpin for ActivityKitBackend
impl UnsafeUnpin for ActivityKitBackendwhere
*const ArcInner<Inner> is !null: UnsafeUnpin,
PhantomData<ArcInner<Inner>>: UnsafeUnpin,
Align4<u32>: UnsafeUnpin,
Align1<u8>: UnsafeUnpin,
*const u8 is !null: UnsafeUnpin,
PhantomData<Activity>: UnsafeUnpin,
*const ArcInner<Mutex<PushTokens>> is !null: UnsafeUnpin,
PhantomData<ArcInner<Mutex<PushTokens>>>: UnsafeUnpin,
PhantomData<()>: UnsafeUnpin,
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