RootlesskitOptions

Struct RootlesskitOptions 

Source
pub struct RootlesskitOptions {
Show 28 fields pub debug: bool, pub copy_up: Vec<String>, pub copy_up_mode: Option<CopyUpMode>, pub propagation: Option<Propagation>, pub net: Option<Net>, pub mtu: Option<usize>, pub cidr: Option<String>, pub ifname: Option<String>, pub disable_host_loopback: bool, pub ipv6: bool, pub detach_netns: bool, pub lxc_user_nic_binary: Option<PathBuf>, pub lxc_user_nic_bridge: Option<String>, pub pasta_binary: Option<PathBuf>, pub slirp4netns_binary: Option<PathBuf>, pub slirp4netns_sandbox: Option<AutoOption>, pub slirp4netns_seccomp: Option<AutoOption>, pub vpnkit_binary: Option<PathBuf>, pub port_driver: Option<PortDriver>, pub publish: Vec<String>, pub pidns: bool, pub cgroupns: bool, pub utsns: bool, pub ipcns: bool, pub reaper: Option<AutoOption>, pub evacuate_cgroup2: Option<String>, pub state_dir: Option<PathBuf>, pub subid_source: Option<SubIdSource>,
}
Expand description

Options for rootlesskit.

Fields§

§debug: bool

Whether to use debug mode.

Corresponds to rootlesskit’s --debug option.

§copy_up: Vec<String>

A list of filesystems to mount and copy-up the contents from.

Corresponds to rootlesskit’s --copy-up option.

§copy_up_mode: Option<CopyUpMode>

The mode to use for RootlesskitOptions::copy_up.

Corresponds to rootlesskit’s --copy-up-mode option.

§propagation: Option<Propagation>

The propagation to use for RootlesskitOptions::copy_up.

Corresponds to rootlesskit’s --propagation option.

§net: Option<Net>

The network driver to use.

Corresponds to rootlesskit’s --net option.

§mtu: Option<usize>

The MTU to use for the network driver.

Defaults to 65520 for Net::Pasta and Net::Slirp4netns, 1500 for all other.

Corresponds to rootlesskit’s --mtu option.

§cidr: Option<String>

The CIDR to use for Net::Pasta and Net::Slirp4netns.

Defaults to 10.0.2.0/24 for Net::Pasta and Net::Slirp4netns.

Corresponds to rootlesskit’s --cidr option.

§ifname: Option<String>

The network interface name to use.

Defaults to tap0 for Net::Pasta, Net::Slirp4netns and Net::Vpnkit, eth0 for Net::LxcUserNic.

Corresponds to rootlesskit’s --ifname option.

§disable_host_loopback: bool

Whether to prohibit connecting to 127.0.0.1:* on the host.

Corresponds to rootlesskit’s --disable-host-loopback option.

§ipv6: bool

Whether to enable IPv6 routing.

Requires net to either be set to Net::Pasta or Net::Slirp4netns.

Corresponds to rootlesskit’s --ipv6 option.

§detach_netns: bool

Whether to detach the network namespaces.

Corresponds to rootlesskit’s --detach-netns option.

§lxc_user_nic_binary: Option<PathBuf>

An alternative path for the lxc-user-nic binary.

Corresponds to rootlesskit’s --lxc-user-nic-binary option.

§lxc_user_nic_bridge: Option<String>

An alternative name for the lxc-user-bridge name.

Corresponds to rootlesskit’s --lxc-user-nic-bridge option.

§pasta_binary: Option<PathBuf>

An alternative path for the pasta binary.

Corresponds to rootlesskit’s --pasta-binary option.

§slirp4netns_binary: Option<PathBuf>

An alternative path for the slirp4netns binary.

Corresponds to rootlesskit’s --slirp4netns-binary option.

§slirp4netns_sandbox: Option<AutoOption>

Whether to enable slirp4netns sandbox.

Corresponds to rootlesskit’s --slirp4netns-sandbox option.

§slirp4netns_seccomp: Option<AutoOption>

Whether to enable slirp4netns seccomp.

Corresponds to rootlesskit’s --slirp4netns-seccomp option.

§vpnkit_binary: Option<PathBuf>

An alternative path for the vpnkit binary.

Corresponds to rootlesskit’s --vpnkit-binary option.

§port_driver: Option<PortDriver>

A port driver to use for the non-host network.

Corresponds to rootlesskit’s --port-driver option.

§publish: Vec<String>

A list of ports to publish.

Corresponds to rootlesskit’s -p/--publish option.

§pidns: bool

Whether to create a PID namespace.

Corresponds to rootlesskit’s --pidns option.

§cgroupns: bool

Whether to create a cgroup namespace.

Corresponds to rootlesskit’s --cgroupns option.

§utsns: bool

Whether to create a UTS namespace.

Corresponds to rootlesskit’s --utsns option.

§ipcns: bool

Whether to create an IPC namespace.

Corresponds to rootlesskit’s --ipcns option.

§reaper: Option<AutoOption>

Whether to enable process reaper.

Requires RootlesskitOptions::pidns to be set to true.

Corresponds to rootlesskit’s --reaper option.

§evacuate_cgroup2: Option<String>

A cgroup2 subgroup to evacuate processes into.

Requires RootlesskitOptions::pidns and RootlesskitOptions::cgroupns to be set to true.

Corresponds to rootlesskit’s --evacuate-cgroup2 option.

§state_dir: Option<PathBuf>

A state directory to use.

Corresponds to rootlesskit’s --state-dir option.

§subid_source: Option<SubIdSource>

The source of subids.

Corresponds to rootlesskit’s --subid-source option.

Trait Implementations§

Source§

impl Clone for RootlesskitOptions

Source§

fn clone(&self) -> RootlesskitOptions

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for RootlesskitOptions

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Default for RootlesskitOptions

Source§

fn default() -> RootlesskitOptions

Returns the “default value” for a type. Read more
Source§

impl Display for RootlesskitOptions

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl PartialEq for RootlesskitOptions

Source§

fn eq(&self, other: &RootlesskitOptions) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl RootlessBackend<RootlesskitOptions> for RootlesskitBackend

Source§

fn new(options: RootlesskitOptions) -> Self

Source§

fn options(&self) -> &RootlesskitOptions

Returns the RootlesskitOptions used by the RootlesskitBackend.

Source§

fn run(&self, cmd: &[&str]) -> Result<Output, Self::Err>

Runs a command using rootlesskit and returns its Output.

§Errors

Returns an error if

Source§

type Err = Error

The Error type to use.
Source§

impl RootlessOptions for RootlesskitOptions

Source§

fn to_vec(&self) -> Vec<String>

Returns the options as a String Vec.

§Notes

All PathBuf options are represented using Path::to_string_lossy.

Source§

impl Eq for RootlesskitOptions

Source§

impl StructuralPartialEq for RootlesskitOptions

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T> ToString for T
where T: Display + ?Sized,

Source§

fn to_string(&self) -> String

Converts the given value to a String. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.