pub struct CommandSpec {
pub program: OsString,
pub args: Vec<String>,
pub cwd: PathBuf,
pub env: HashMap<String, String>,
pub expiration: ExecExpiration,
pub sandbox_permissions: SandboxPermissions,
pub justification: Option<String>,
}Expand description
Specification for a command to be executed.
Fields§
§program: OsStringThe program to execute.
args: Vec<String>Arguments to pass to the program.
cwd: PathBufWorking directory for the command.
env: HashMap<String, String>Environment variables to set.
expiration: ExecExpirationExpiration mechanism for the command.
sandbox_permissions: SandboxPermissionsSandbox permissions for this command.
justification: Option<String>Optional justification for why the command needs to run.
Implementations§
Source§impl CommandSpec
impl CommandSpec
Sourcepub fn with_args(
self,
args: impl IntoIterator<Item = impl Into<String>>,
) -> Self
pub fn with_args( self, args: impl IntoIterator<Item = impl Into<String>>, ) -> Self
Add arguments to the command.
Sourcepub fn with_expiration(self, expiration: ExecExpiration) -> Self
pub fn with_expiration(self, expiration: ExecExpiration) -> Self
Set the expiration.
Sourcepub fn with_sandbox_permissions(self, permissions: SandboxPermissions) -> Self
pub fn with_sandbox_permissions(self, permissions: SandboxPermissions) -> Self
Set sandbox permissions.
Sourcepub fn with_justification(self, justification: impl Into<String>) -> Self
pub fn with_justification(self, justification: impl Into<String>) -> Self
Set a justification.
Sourcepub fn full_command(&self) -> Vec<OsString>
pub fn full_command(&self) -> Vec<OsString>
Get the full command as a vector.
Trait Implementations§
Source§impl Clone for CommandSpec
impl Clone for CommandSpec
Source§fn clone(&self) -> CommandSpec
fn clone(&self) -> CommandSpec
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · 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 CommandSpec
impl Debug for CommandSpec
Auto Trait Implementations§
impl Freeze for CommandSpec
impl RefUnwindSafe for CommandSpec
impl Send for CommandSpec
impl Sync for CommandSpec
impl Unpin for CommandSpec
impl UnsafeUnpin for CommandSpec
impl UnwindSafe for CommandSpec
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