pub struct NotificationProxyClient {
pub idevice: Idevice,
}Expand description
Client for interacting with the iOS notification proxy service
The notification proxy service provides a mechanism to observe and post system notifications.
Use observe_notification to register for events, then receive_notification
to wait for them.
Fields§
§idevice: IdeviceThe underlying device connection with established notification_proxy service
Implementations§
Source§impl NotificationProxyClient
impl NotificationProxyClient
Sourcepub fn new(idevice: Idevice) -> Self
pub fn new(idevice: Idevice) -> Self
Creates a new notification proxy client from an existing device connection
§Arguments
idevice- Pre-established device connection
Sourcepub async fn post_notification(
&mut self,
notification_name: impl Into<String>,
) -> Result<(), IdeviceError>
pub async fn post_notification( &mut self, notification_name: impl Into<String>, ) -> Result<(), IdeviceError>
Sourcepub async fn observe_notification(
&mut self,
notification_name: impl Into<String>,
) -> Result<(), IdeviceError>
pub async fn observe_notification( &mut self, notification_name: impl Into<String>, ) -> Result<(), IdeviceError>
Sourcepub async fn observe_notifications(
&mut self,
notification_names: &[&str],
) -> Result<(), IdeviceError>
pub async fn observe_notifications( &mut self, notification_names: &[&str], ) -> Result<(), IdeviceError>
Sourcepub async fn receive_notification(&mut self) -> Result<String, IdeviceError>
pub async fn receive_notification(&mut self) -> Result<String, IdeviceError>
Sourcepub async fn receive_notification_with_timeout(
&mut self,
interval: u64,
) -> Result<String, IdeviceError>
pub async fn receive_notification_with_timeout( &mut self, interval: u64, ) -> Result<String, IdeviceError>
Waits for a notification with a timeout
§Arguments
interval- Timeout in seconds to wait for a notification
§Returns
The name of the received notification
§Errors
NotificationProxyDeathif the proxy connection diedUnexpectedResponseif the response format is invalidHeartbeatTimeoutif no notification received before interval
Sourcepub fn into_stream(
self,
) -> Pin<Box<dyn Stream<Item = Result<String, IdeviceError>> + Send>>
pub fn into_stream( self, ) -> Pin<Box<dyn Stream<Item = Result<String, IdeviceError>> + Send>>
Continuous stream of notifications.
Trait Implementations§
Source§impl Debug for NotificationProxyClient
impl Debug for NotificationProxyClient
Source§impl IdeviceService for NotificationProxyClient
impl IdeviceService for NotificationProxyClient
Source§fn service_name() -> Cow<'static, str>
fn service_name() -> Cow<'static, str>
Returns the notification proxy service name as registered with lockdownd
async fn from_stream(idevice: Idevice) -> Result<Self, IdeviceError>
Source§async fn connect(provider: &dyn IdeviceProvider) -> Result<Self, IdeviceError>
async fn connect(provider: &dyn IdeviceProvider) -> Result<Self, IdeviceError>
Establishes a connection to this service Read more
Source§impl RsdService for NotificationProxyClient
Available on crate feature rsd only.
impl RsdService for NotificationProxyClient
Available on crate feature
rsd only.fn rsd_service_name() -> Cow<'static, str>
async fn from_stream(stream: Box<dyn ReadWrite>) -> Result<Self, IdeviceError>
fn connect_rsd(
provider: &mut impl RsdProvider,
handshake: &mut RsdHandshake,
) -> impl Future<Output = Result<Self, IdeviceError>>where
Self: RsdService,
Auto Trait Implementations§
impl !RefUnwindSafe for NotificationProxyClient
impl !UnwindSafe for NotificationProxyClient
impl Forget for NotificationProxyClient
impl Freeze for NotificationProxyClient
impl Send for NotificationProxyClient
impl Sync for NotificationProxyClient
impl Unpin for NotificationProxyClient
impl UnsafeUnpin for NotificationProxyClient
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