pub struct PersistentIpcClientHandle { /* private fields */ }Expand description
Handle to a persistent IPC client that maintains a long-lived connection to the headless sidecar.
The background task automatically:
- Relays
IpcEventframes toapp.emit("background-service://event", ...) - Reconnects on connection failure with exponential backoff (1s–30s, up to 10 retries)
- Forwards commands (start/stop/is_running) over the same connection
Implementations§
Source§impl PersistentIpcClientHandle
impl PersistentIpcClientHandle
Sourcepub fn spawn<R: Runtime>(socket_path: PathBuf, app: AppHandle<R>) -> Self
pub fn spawn<R: Runtime>(socket_path: PathBuf, app: AppHandle<R>) -> Self
Spawn the persistent IPC client background task.
The task immediately begins trying to connect to the socket at
socket_path. Events are relayed to the Tauri event system via
app.emit().
Sourcepub async fn start(&self, config: StartConfig) -> Result<(), ServiceError>
pub async fn start(&self, config: StartConfig) -> Result<(), ServiceError>
Send a Start command through the persistent connection.
Sourcepub async fn stop(&self) -> Result<(), ServiceError>
pub async fn stop(&self) -> Result<(), ServiceError>
Send a Stop command through the persistent connection.
Sourcepub async fn is_running(&self) -> Result<bool, ServiceError>
pub async fn is_running(&self) -> Result<bool, ServiceError>
Query whether the service is running through the persistent connection.
Sourcepub async fn get_state(&self) -> Result<ServiceStatus, ServiceError>
pub async fn get_state(&self) -> Result<ServiceStatus, ServiceError>
Query the current service lifecycle state through the persistent connection.
Sourcepub fn is_connected(&self) -> bool
pub fn is_connected(&self) -> bool
Returns true if the persistent client is currently connected to the
headless sidecar, false otherwise.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for PersistentIpcClientHandle
impl RefUnwindSafe for PersistentIpcClientHandle
impl Send for PersistentIpcClientHandle
impl Sync for PersistentIpcClientHandle
impl Unpin for PersistentIpcClientHandle
impl UnsafeUnpin for PersistentIpcClientHandle
impl UnwindSafe for PersistentIpcClientHandle
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