pub struct InferenceEngine { /* private fields */ }Expand description
Manages the PIE (Proxy Inference Engine) process lifecycle.
Handles:
- Binary fetching if not installed
- Process spawning with proper daemonization
- Per-process lease tracking for orchard-rs clients
- Registration with PIE’s management plane
Implementations§
Source§impl InferenceEngine
impl InferenceEngine
Sourcepub async fn new() -> Result<Self>
pub async fn new() -> Result<Self>
Create a new InferenceEngine and connect to (or spawn) the engine process.
Sourcepub async fn with_options(
paths: EnginePaths,
startup_timeout: Option<Duration>,
) -> Result<Self>
pub async fn with_options( paths: EnginePaths, startup_timeout: Option<Duration>, ) -> Result<Self>
Create with custom options.
Sourcepub fn close(&mut self) -> Result<()>
pub fn close(&mut self) -> Result<()>
Close this engine instance.
Releases this process’s orchard-rs lease and best-effort deregisters the client with PIE. Normal disconnect never sends signals to PIE.
Sourcepub fn shutdown(timeout: Duration) -> Result<()>
pub fn shutdown(timeout: Duration) -> Result<()>
Force shutdown the engine regardless of reference count.
Sourcepub fn generate_response_channel_id() -> u64
pub fn generate_response_channel_id() -> u64
Generate a unique response channel ID for this client.
Format: (PID << 32) | random_32_bits Uses true randomness to avoid collisions between rapid successive calls.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for InferenceEngine
impl !RefUnwindSafe for InferenceEngine
impl Send for InferenceEngine
impl Sync for InferenceEngine
impl Unpin for InferenceEngine
impl UnsafeUnpin for InferenceEngine
impl !UnwindSafe for InferenceEngine
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