pub struct ContainerCommandExecutor { /* private fields */ }Expand description
CLI-based container executor that shells out to docker run per execution.
Each execute call spawns a new ephemeral container.
This is simpler but less efficient than [DockerExecutor] which reuses a
persistent container.
For production use, prefer [DockerExecutor] (behind the docker feature).
§Example
use adk_code::{CodeExecutor, ContainerCommandExecutor, ContainerConfig, ExecutionIsolation};
let executor = ContainerCommandExecutor::default();
assert_eq!(executor.name(), "container-command");
assert_eq!(executor.capabilities().isolation, ExecutionIsolation::ContainerEphemeral);Implementations§
Source§impl ContainerCommandExecutor
impl ContainerCommandExecutor
Sourcepub fn new(config: ContainerConfig) -> Self
pub fn new(config: ContainerConfig) -> Self
Create a new container command executor with the given configuration.
Trait Implementations§
Source§impl Clone for ContainerCommandExecutor
impl Clone for ContainerCommandExecutor
Source§fn clone(&self) -> ContainerCommandExecutor
fn clone(&self) -> ContainerCommandExecutor
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 moreSource§impl CodeExecutor for ContainerCommandExecutor
impl CodeExecutor for ContainerCommandExecutor
Source§fn capabilities(&self) -> BackendCapabilities
fn capabilities(&self) -> BackendCapabilities
The capabilities this backend can enforce.
Source§fn supports_language(&self, lang: &ExecutionLanguage) -> bool
fn supports_language(&self, lang: &ExecutionLanguage) -> bool
Whether this backend supports the given language.
Source§fn execute<'life0, 'async_trait>(
&'life0 self,
request: ExecutionRequest,
) -> Pin<Box<dyn Future<Output = Result<ExecutionResult, ExecutionError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn execute<'life0, 'async_trait>(
&'life0 self,
request: ExecutionRequest,
) -> Pin<Box<dyn Future<Output = Result<ExecutionResult, ExecutionError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Execute a request and return a structured result.
Source§fn start<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<(), ExecutionError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn start<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<(), ExecutionError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Start the execution environment (e.g., create and start a container). Read more
Source§fn stop<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<(), ExecutionError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn stop<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<(), ExecutionError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Stop the execution environment and release resources. Read more
Source§impl Debug for ContainerCommandExecutor
impl Debug for ContainerCommandExecutor
Auto Trait Implementations§
impl Freeze for ContainerCommandExecutor
impl RefUnwindSafe for ContainerCommandExecutor
impl Send for ContainerCommandExecutor
impl Sync for ContainerCommandExecutor
impl Unpin for ContainerCommandExecutor
impl UnsafeUnpin for ContainerCommandExecutor
impl UnwindSafe for ContainerCommandExecutor
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