pub struct LocalRuntime { /* private fields */ }Expand description
Local runtime that manages bash sessions and file operations.
Each session is backed by a persistent docker exec process.
Implementations§
Source§impl LocalRuntime
impl LocalRuntime
Sourcepub fn new(container_id: impl Into<String>) -> Self
pub fn new(container_id: impl Into<String>) -> Self
Create a new local runtime attached to the given container.
Sourcepub fn is_alive(&self) -> IsAliveResponse
pub fn is_alive(&self) -> IsAliveResponse
Health check.
Sourcepub async fn create_session(
&mut self,
request: &CreateSessionRequest,
) -> Result<CreateSessionResponse>
pub async fn create_session( &mut self, request: &CreateSessionRequest, ) -> Result<CreateSessionResponse>
Create a new bash session.
Sourcepub async fn run_in_session(
&mut self,
action: &BashAction,
) -> Result<BashObservation>
pub async fn run_in_session( &mut self, action: &BashAction, ) -> Result<BashObservation>
Run a command in an existing session.
Sourcepub async fn close_session(
&mut self,
request: &CloseSessionRequest,
) -> CloseSessionResponse
pub async fn close_session( &mut self, request: &CloseSessionRequest, ) -> CloseSessionResponse
Close a session.
Sourcepub async fn read_file(
&self,
request: &ReadFileRequest,
) -> Result<ReadFileResponse>
pub async fn read_file( &self, request: &ReadFileRequest, ) -> Result<ReadFileResponse>
Read a file from inside the container via docker exec cat.
Sourcepub async fn write_file(
&self,
request: &WriteFileRequest,
) -> Result<WriteFileResponse>
pub async fn write_file( &self, request: &WriteFileRequest, ) -> Result<WriteFileResponse>
Write a file inside the container via docker exec.
Sourcepub fn container_id(&self) -> &str
pub fn container_id(&self) -> &str
Get the container ID.
Auto Trait Implementations§
impl Freeze for LocalRuntime
impl RefUnwindSafe for LocalRuntime
impl Send for LocalRuntime
impl Sync for LocalRuntime
impl Unpin for LocalRuntime
impl UnsafeUnpin for LocalRuntime
impl UnwindSafe for LocalRuntime
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