#[non_exhaustive]pub struct ContainerSpawnRequest {
pub task: String,
pub image: Option<String>,
pub policy: SandboxPolicy,
pub capabilities: Capabilities,
pub env: HashMap<String, String>,
pub command: Option<Vec<String>>,
}Expand description
Request to spawn a new agent container.
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Non-exhaustive structs could have additional fields added in future. Therefore, non-exhaustive structs cannot be constructed in external crates using the traditional
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.task: StringHuman-readable task description for this container.
image: Option<String>Docker image override. When None, uses the server default.
policy: SandboxPolicySandbox policy for the container. Defaults to WasmOnly.
capabilities: CapabilitiesCapability requirements for the container.
env: HashMap<String, String>Extra environment variables injected into the container.
command: Option<Vec<String>>Optional command to run in the container (overrides image CMD).
Implementations§
Source§impl ContainerSpawnRequest
impl ContainerSpawnRequest
Sourcepub fn new(task: impl Into<String>, capabilities: Capabilities) -> Self
pub fn new(task: impl Into<String>, capabilities: Capabilities) -> Self
Create a container spawn request for the given task with specified capabilities.
Sourcepub fn with_policy(self, policy: SandboxPolicy) -> Self
pub fn with_policy(self, policy: SandboxPolicy) -> Self
Override the sandbox policy.
Sourcepub fn with_image(self, image: impl Into<String>) -> Self
pub fn with_image(self, image: impl Into<String>) -> Self
Set the Docker image.
Sourcepub fn with_command(self, cmd: Vec<String>) -> Self
pub fn with_command(self, cmd: Vec<String>) -> Self
Set the container command.
Trait Implementations§
Source§impl Clone for ContainerSpawnRequest
impl Clone for ContainerSpawnRequest
Source§fn clone(&self) -> ContainerSpawnRequest
fn clone(&self) -> ContainerSpawnRequest
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 Debug for ContainerSpawnRequest
impl Debug for ContainerSpawnRequest
Source§impl<'de> Deserialize<'de> for ContainerSpawnRequest
impl<'de> Deserialize<'de> for ContainerSpawnRequest
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations§
impl Freeze for ContainerSpawnRequest
impl RefUnwindSafe for ContainerSpawnRequest
impl Send for ContainerSpawnRequest
impl Sync for ContainerSpawnRequest
impl Unpin for ContainerSpawnRequest
impl UnsafeUnpin for ContainerSpawnRequest
impl UnwindSafe for ContainerSpawnRequest
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