Skip to main content

PlatformServiceHub

Struct PlatformServiceHub 

Source
pub struct PlatformServiceHub { /* private fields */ }
Expand description

Unified per-app hub coordinating permissions, protocols, Dynamic Island / Live Activities, haptics, tray, and A11y announcements.

Implementations§

Source§

impl PlatformServiceHub

Platform-aware Dynamic Island, permissions, haptics, tray, sharing, and A11y dispatch for PlatformServiceHub.

Source

pub const fn default_island_mode( platform: PlatformKind, ) -> IslandPresentationMode

Resolves the optimal live-activity presentation surface for platform.

§Arguments
  • PlatformKind - Target execution platform.
§Returns
  • IslandPresentationMode - Native Dynamic Island or graceful platform fallback mode.
Source

pub fn start_live_activity( &mut self, activity_id: String, content: LiveActivityContent, ) -> LiveActivityHandle

Starts a Dynamic Island / Live Activity session on iOS/iPadOS or a graceful fallback on other platforms.

§Arguments
  • &Self - Mutable service hub.
  • String - Unique activity identifier.
  • LiveActivityContent - Declarative compact, minimal, and expanded content payload.
§Returns
  • LiveActivityHandle - Handle describing the active live activity and resolved presentation mode.
Source

pub fn update_live_activity( &mut self, activity_id: &str, content: LiveActivityContent, ) -> bool

Updates an active Dynamic Island / Live Activity in place.

§Arguments
  • &Self - Mutable service hub.
  • &str - Activity identifier.
  • LiveActivityContent - Updated content payload.
§Returns
  • bool - true when an active session matching activity_id was updated.
Source

pub fn end_live_activity(&mut self, activity_id: &str) -> bool

Ends an active Dynamic Island / Live Activity session.

§Arguments
  • &Self - Mutable service hub.
  • &str - Activity identifier.
§Returns
  • bool - true when an active session was terminated.
Source

pub fn trigger_haptic(&mut self, style: HapticStyle) -> bool

Triggers a tactile haptic pulse when supported by the active platform.

§Arguments
  • &Self - Mutable service hub.
  • HapticStyle - Requested tactile waveform.
§Returns
  • bool - true when dispatched on a haptic-capable platform.
Source

pub fn biometric_kind(&self) -> BiometricKind

Returns the native biometric authentication provider available on the active platform.

§Arguments
  • &Self - Service hub reference.
§Returns
  • BiometricKind - Platform biometric authenticator kind.
Source

pub fn configure_tray( &mut self, config: SystemTrayConfig, ) -> Result<(), PlatformError>

Installs or updates the desktop system tray / menu bar configuration.

§Arguments
  • &Self - Mutable service hub.
  • SystemTrayConfig - Tray icon tooltip, title, and menu items.
§Returns
  • Result<(), PlatformError> - Ok(()) on desktop targets, or Unsupported on mobile/Web.
Source

pub fn tray_config(&self) -> Option<&SystemTrayConfig>

Returns the active desktop tray configuration, if installed.

§Arguments
  • &Self - Service hub reference.
§Returns
  • Option<&SystemTrayConfig> - Configured tray metadata.
Source

pub fn send_notification(&mut self, notification: SystemNotification)

Dispatches a native OS notification and records it in telemetry.

§Arguments
  • &Self - Mutable service hub.
  • SystemNotification - Notification payload.
Source

pub fn announce_a11y(&mut self, message: String, politeness: A11yLiveRegion)

Queues a screen reader accessibility live announcement.

§Arguments
  • &Self - Mutable service hub.
  • String - Message text to announce.
  • A11yLiveRegion - Politeness priority.
Source

pub fn share(&self, payload: &SharePayload) -> Result<String, PlatformError>

Resolves the native OS share sheet API descriptor for payload.

§Arguments
  • &Self - Service hub reference.
  • &SharePayload - Share sheet title, text, and optional URL.
§Returns
  • Result<String, PlatformError> - Native OS share dispatcher description.
Source§

impl PlatformServiceHub

Source

pub fn get_platform(&self) -> PlatformKind

Source

pub fn get_mut_platform(&mut self) -> &mut PlatformKind

Source

pub fn set_platform(&mut self, val: PlatformKind) -> &mut Self

Source

pub fn get_permissions(&self) -> &PermissionManager

Source

pub fn get_mut_permissions(&mut self) -> &mut PermissionManager

Source

pub fn set_permissions(&mut self, val: PermissionManager) -> &mut Self

Source

pub fn get_protocols(&self) -> &ProtocolRegistry

Source

pub fn get_mut_protocols(&mut self) -> &mut ProtocolRegistry

Source

pub fn set_protocols(&mut self, val: ProtocolRegistry) -> &mut Self

Source

pub fn get_live_activities(&self) -> &Vec<LiveActivityHandle>

Source

pub fn get_mut_live_activities(&mut self) -> &mut Vec<LiveActivityHandle>

Source

pub fn set_live_activities(&mut self, val: Vec<LiveActivityHandle>) -> &mut Self

Source

pub fn get_notifications(&self) -> &Vec<SystemNotification>

Source

pub fn get_mut_notifications(&mut self) -> &mut Vec<SystemNotification>

Source

pub fn set_notifications(&mut self, val: Vec<SystemNotification>) -> &mut Self

Source

pub fn get_announcements(&self) -> &Vec<A11yAnnouncement>

Source

pub fn get_mut_announcements(&mut self) -> &mut Vec<A11yAnnouncement>

Source

pub fn set_announcements(&mut self, val: Vec<A11yAnnouncement>) -> &mut Self

Source

pub fn get_mut_tray(&mut self) -> &mut Option<SystemTrayConfig>

Source

pub fn set_tray(&mut self, val: Option<SystemTrayConfig>) -> &mut Self

Source

pub fn get_haptic_count(&self) -> u64

Source

pub fn get_mut_haptic_count(&mut self) -> &mut u64

Source

pub fn set_haptic_count(&mut self, val: u64) -> &mut Self

Source§

impl PlatformServiceHub

Source

pub fn new(platform: PlatformKind) -> Self

Trait Implementations§

Source§

impl Clone for PlatformServiceHub

Source§

fn clone(&self) -> Self

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

impl Debug for PlatformServiceHub

Source§

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

Formats the value using the given formatter. Read more
Source§

impl Default for PlatformServiceHub

Source§

fn default() -> Self

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

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

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

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> 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 = !

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.