mlld Rust SDK
Rust wrapper for mlld using a persistent NDJSON RPC transport over mlld live --stdio.
Installation
[]
= "0.1"
Requirements
- Rust 2021 edition
- Node.js runtime
- mlld CLI available by command path
Quick Start
use ;
use json;
use HashMap;
use Duration;
In-Flight State Updates
use ;
use json;
use Duration;
let client = new;
let mut handle = client.process_async?;
sleep;
handle.update_state?;
let output = handle.result?;
println!;
API
Client
Client::new()with_command(command)with_command_args(args)with_timeout(timeout)with_working_dir(dir)close()process(script, opts)process_async(script, opts) -> ProcessHandleexecute(filepath, payload, opts)execute_async(filepath, payload, opts) -> ExecuteHandleanalyze(filepath)
Handle Methods
ProcessHandle and ExecuteHandle both provide:
request_id()cancel()update_state(path, value)wait()result()
Convenience Functions
mlld::process(...)mlld::execute(...)mlld::analyze(...)
Notes
- Each
Clientkeeps one live RPC subprocess for repeated calls. ExecuteResult.state_writesmerges final-result writes and streamedstate:writeevents.ExecuteResult.denialscollects structured guard/policy label-flow denials observed during execution.- Blocking client methods remain as wrappers around handle APIs.