pub struct AgentKernel { /* private fields */ }Expand description
Client for the agentkernel HTTP API.
§Example
let client = agentkernel_sdk::AgentKernel::builder().build()?;
let output = client.run(&["echo", "hello"], None).await?;
println!("{}", output.output);Implementations§
Source§impl AgentKernel
impl AgentKernel
Sourcepub fn builder() -> AgentKernelBuilder
pub fn builder() -> AgentKernelBuilder
Create a new builder with defaults resolved from env vars.
Sourcepub async fn run(
&self,
command: &[&str],
opts: Option<RunOptions>,
) -> Result<RunOutput>
pub async fn run( &self, command: &[&str], opts: Option<RunOptions>, ) -> Result<RunOutput>
Run a command in a temporary sandbox.
Sourcepub async fn list_sandboxes(&self) -> Result<Vec<SandboxInfo>>
pub async fn list_sandboxes(&self) -> Result<Vec<SandboxInfo>>
List all sandboxes.
Sourcepub async fn create_sandbox(
&self,
name: &str,
image: Option<&str>,
) -> Result<SandboxInfo>
pub async fn create_sandbox( &self, name: &str, image: Option<&str>, ) -> Result<SandboxInfo>
Create a new sandbox.
Sourcepub async fn get_sandbox(&self, name: &str) -> Result<SandboxInfo>
pub async fn get_sandbox(&self, name: &str) -> Result<SandboxInfo>
Get info about a sandbox.
Sourcepub async fn remove_sandbox(&self, name: &str) -> Result<()>
pub async fn remove_sandbox(&self, name: &str) -> Result<()>
Remove a sandbox.
Sourcepub async fn exec_in_sandbox(
&self,
name: &str,
command: &[&str],
) -> Result<RunOutput>
pub async fn exec_in_sandbox( &self, name: &str, command: &[&str], ) -> Result<RunOutput>
Run a command in an existing sandbox.
Trait Implementations§
Source§impl Clone for AgentKernel
impl Clone for AgentKernel
Source§fn clone(&self) -> AgentKernel
fn clone(&self) -> AgentKernel
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for AgentKernel
impl !RefUnwindSafe for AgentKernel
impl Send for AgentKernel
impl Sync for AgentKernel
impl Unpin for AgentKernel
impl !UnwindSafe for AgentKernel
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