pub struct NewCommand {
pub command: CommandLine,
pub cwd: Option<String>,
pub env: BTreeMap<String, String>,
pub stdin: bool,
}Expand description
A command to run in a sandbox, POST /api/sandboxes/{id}/commands’ body.
Fields§
§command: CommandLine§cwd: Option<String>The directory it starts in, from the image’s working directory if relative; the image’s, unless given.
env: BTreeMap<String, String>Variables it’s given, after the sandbox’s, or in place of theirs.
stdin: boolWhether it takes stdin, sent to it (POST …/commands/{n}/stdin)
until its close; else it reads /dev/null.
Implementations§
Source§impl NewCommand
impl NewCommand
Sourcepub fn check(&self) -> Result<(), String>
pub fn check(&self) -> Result<(), String>
Whether a sandbox may be asked to run it, and why not: an argv names its program, no string holds a NUL, and each variable’s name is one a shell takes. A sandbox refuses what it can’t run besides (a script in an image with no shell), as the command’s state says.
Trait Implementations§
Source§impl Clone for NewCommand
impl Clone for NewCommand
Source§impl Debug for NewCommand
impl Debug for NewCommand
Source§impl<'de> Deserialize<'de> for NewCommand
impl<'de> Deserialize<'de> for NewCommand
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
impl Eq for NewCommand
Source§impl PartialEq for NewCommand
impl PartialEq for NewCommand
Source§impl Serialize for NewCommand
impl Serialize for NewCommand
impl StructuralPartialEq for NewCommand
Auto Trait Implementations§
impl Forget for NewCommand
impl Freeze for NewCommand
impl RefUnwindSafe for NewCommand
impl Send for NewCommand
impl Sync for NewCommand
impl Unpin for NewCommand
impl UnsafeUnpin for NewCommand
impl UnwindSafe for NewCommand
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