pub struct Action { /* private fields */ }Expand description
A sandbox action configuration.
Actions define how sandboxes are set up and torn down. Each action specifies an operation to perform (mount, copy, symlink, or cmd) along with the parameters needed for that operation.
Actions are processed in order during sandbox creation and in reverse order during destruction.
§Fields
The available fields depend on the action type:
§Mount Actions
| Field | Required | Description |
|---|---|---|
fs | yes | Filesystem type (bind, dev, fd, nfs, proc, tmp) |
dir or src/dest | yes | Mount point path |
opts | no | Mount options (e.g., “ro”, “size=1G”) |
ifexists | no | Only mount if source exists (default: false) |
§Copy Actions
| Field | Required | Description |
|---|---|---|
dir or src/dest | yes | Path to copy |
§Symlink Actions
| Field | Required | Description |
|---|---|---|
src | yes | Link target (what the symlink points to) |
dest | yes | Link name (the symlink itself) |
§Cmd Actions
| Field | Required | Description |
|---|---|---|
create | no | Command to run during sandbox creation |
destroy | no | Command to run during sandbox destruction |
chroot | no | If true, run command inside sandbox chroot (default: false) |
When chroot = true, commands run inside the sandbox via chroot with /
as the working directory. Use cd /path && in the command if a different
working directory is needed.
When chroot = false (default), commands run on the host system with the
sandbox root as the working directory.
Implementations§
Source§impl Action
impl Action
pub fn from_lua(t: &Table) -> LuaResult<Self>
pub fn src(&self) -> Option<&PathBuf>
pub fn dest(&self) -> Option<&PathBuf>
pub fn action_type(&self) -> Result<ActionType, Error>
pub fn fs_type(&self) -> Result<FSType, Error>
pub fn opts(&self) -> Option<&String>
pub fn create_cmd(&self) -> Option<&String>
pub fn destroy_cmd(&self) -> Option<&String>
pub fn chroot(&self) -> bool
pub fn ifexists(&self) -> bool
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Action
impl RefUnwindSafe for Action
impl Send for Action
impl Sync for Action
impl Unpin for Action
impl UnwindSafe for Action
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more