Struct apt_cmd::Dpkg[][src]

pub struct Dpkg(_);

Implementations

Methods from Deref<Target = Command>

Adds a single argument to pass to the program.

Examples
use async_process::Command;

let mut cmd = Command::new("echo");
cmd.arg("hello");
cmd.arg("world");

Adds multiple arguments to pass to the program.

Examples
use async_process::Command;

let mut cmd = Command::new("echo");
cmd.args(&["hello", "world"]);

Configures an environment variable for the new process.

Note that environment variable names are case-insensitive (but case-preserving) on Windows, and case-sensitive on all other platforms.

Examples
use async_process::Command;

let mut cmd = Command::new("ls");
cmd.env("PATH", "/bin");

Configures multiple environment variables for the new process.

Note that environment variable names are case-insensitive (but case-preserving) on Windows, and case-sensitive on all other platforms.

Examples
use async_process::Command;

let mut cmd = Command::new("ls");
cmd.envs(vec![("PATH", "/bin"), ("TERM", "xterm-256color")]);

Removes an environment variable mapping.

Examples
use async_process::Command;

let mut cmd = Command::new("ls");
cmd.env_remove("PATH");

Removes all environment variable mappings.

Examples
use async_process::Command;

let mut cmd = Command::new("ls");
cmd.env_clear();

Configures the working directory for the new process.

Examples
use async_process::Command;

let mut cmd = Command::new("ls");
cmd.current_dir("/");

Configures the standard input (stdin) for the new process.

Examples
use async_process::{Command, Stdio};

let mut cmd = Command::new("cat");
cmd.stdin(Stdio::null());

Configures the standard output (stdout) for the new process.

Examples
use async_process::{Command, Stdio};

let mut cmd = Command::new("ls");
cmd.stdout(Stdio::piped());

Configures the standard error (stderr) for the new process.

Examples
use async_process::{Command, Stdio};

let mut cmd = Command::new("ls");
cmd.stderr(Stdio::piped());

Configures whether to reap the zombie process when Child is dropped.

When the process finishes, it becomes a “zombie” and some resources associated with it remain until Child::try_status(), Child::status(), or Child::output() collects its exit code.

If its exit code is never collected, the resources may leak forever. This crate has a background thread named “async-process” that collects such “zombie” processes and then “reaps” them, thus preventing the resource leaks.

The default value of this option is true.

Examples
use async_process::{Command, Stdio};

let mut cmd = Command::new("cat");
cmd.reap_on_drop(false);

Configures whether to kill the process when Child is dropped.

The default value of this option is false.

Examples
use async_process::{Command, Stdio};

let mut cmd = Command::new("cat");
cmd.kill_on_drop(true);

Executes the command and returns the Child handle to it.

If not configured, stdin, stdout and stderr will be set to Stdio::inherit().

After spawning the process, stdin, stdout, and stderr become unconfigured again.

Examples
use async_process::Command;

let child = Command::new("ls").spawn()?;

Executes the command, waits for it to exit, and returns the exit status.

If not configured, stdin, stdout and stderr will be set to Stdio::inherit().

After spawning the process, stdin, stdout, and stderr become unconfigured again.

Examples
use async_process::Command;

let status = Command::new("cp")
    .arg("a.txt")
    .arg("b.txt")
    .status()
    .await?;

Executes the command and collects its output.

If not configured, stdin will be set to Stdio::null(), and stdout and stderr will be set to Stdio::piped().

After spawning the process, stdin, stdout, and stderr become unconfigured again.

Examples
use async_process::Command;

let output = Command::new("cat")
    .arg("a.txt")
    .output()
    .await?;

Trait Implementations

Performs the conversion.

The resulting type after dereferencing.

Dereferences the value.

Mutably dereferences the value.

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Performs the conversion.

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more

Instruments this type with the current Span, returning an Instrumented wrapper. Read more

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more

Instruments this type with the current Span, returning an Instrumented wrapper. Read more

Performs the conversion.

The alignment of pointer.

The type for initializers.

Initializes a with the given initializer. Read more

Dereferences the given pointer. Read more

Mutably dereferences the given pointer. Read more

Drops the object pointed to by the given pointer. Read more

Should always be Self

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more