pub struct Sidecar(/* private fields */);Expand description
A running, supervised sidecar. Cheaply cloneable (Arc inside); dropping the last clone
kills the child.
Implementations§
Source§impl Sidecar
impl Sidecar
Sourcepub fn spawn<R: Runtime>(
app: &AppHandle<R>,
opts: SidecarOptions,
) -> Result<Sidecar, String>
pub fn spawn<R: Runtime>( app: &AppHandle<R>, opts: SidecarOptions, ) -> Result<Sidecar, String>
Spawn the sidecar and block until it is healthy (or ready_timeout elapses), then
start the background event-stream bridge and crash supervisor. Returns an error if the
process cannot be spawned or never becomes healthy.
Sourcepub fn request(&self, command: &str, args: Value) -> CliResult
pub fn request(&self, command: &str, args: Value) -> CliResult
Send a command to the sidecar and return its CliResult. Blocking — call from an
async Tauri command via tauri::async_runtime::spawn_blocking. A transport failure is
mapped to a failed CliResult so callers always get a uniform envelope.
Trait Implementations§
Auto Trait Implementations§
impl !RefUnwindSafe for Sidecar
impl !UnwindSafe for Sidecar
impl Freeze for Sidecar
impl Send for Sidecar
impl Sync for Sidecar
impl Unpin for Sidecar
impl UnsafeUnpin for Sidecar
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