pub struct PrivateApiService { /* private fields */ }Expand description
The Private API service manages the TCP server and connected dylib clients.
Implementations§
Source§impl PrivateApiService
impl PrivateApiService
pub fn new() -> Self
Sourcepub fn subscribe_events(&self) -> Receiver<RawEvent>
pub fn subscribe_events(&self) -> Receiver<RawEvent>
Subscribe to incoming events from the dylib.
Sourcepub fn transaction_manager(&self) -> &Arc<TransactionManager>
pub fn transaction_manager(&self) -> &Arc<TransactionManager>
Get a reference to the transaction manager.
Sourcepub async fn is_connected(&self) -> bool
pub async fn is_connected(&self) -> bool
Check if any dylib clients are connected.
Sourcepub fn is_messages_ready(&self) -> bool
pub fn is_messages_ready(&self) -> bool
Check if the Messages.app dylib has finished IMCore initialization.
Sourcepub fn is_facetime_ready(&self) -> bool
pub fn is_facetime_ready(&self) -> bool
Check if the FaceTime.app dylib is ready.
Sourcepub fn is_findmy_ready(&self) -> bool
pub fn is_findmy_ready(&self) -> bool
Check if the FindMy.app dylib is ready.
Sourcepub fn clear_findmy_ready(&self)
pub fn clear_findmy_ready(&self)
Clear the FindMy readiness flag (used before restarting FindMy.app).
Sourcepub async fn start(&mut self) -> Result<JoinHandle<()>>
pub async fn start(&mut self) -> Result<JoinHandle<()>>
Start the TCP server. Returns a handle to the server task.
Sourcepub async fn send_action(
&self,
action: Action,
) -> Result<Option<TransactionResult>>
pub async fn send_action( &self, action: Action, ) -> Result<Option<TransactionResult>>
Send an action to all connected clients, optionally awaiting a transaction response.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for PrivateApiService
impl !RefUnwindSafe for PrivateApiService
impl Send for PrivateApiService
impl Sync for PrivateApiService
impl Unpin for PrivateApiService
impl UnsafeUnpin for PrivateApiService
impl !UnwindSafe for PrivateApiService
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
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
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 moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
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