Skip to main content

AtomicAction

Enum AtomicAction 

Source
#[non_exhaustive]
pub enum AtomicAction { Shell { argv: Vec<String>, }, Pipeline { argv: Vec<String>, }, FsRead { path: String, }, FsWrite { path: String, }, Net { host: String, }, Fetch { host: String, }, NetWord { host: String, }, WebSearch { query: String, }, UnknownTool { host: String, tool: String, }, EnvRead { name: String, }, EnvSet { name: String, }, McpTool { name: String, }, }
Expand description

The primitive operations an Action decomposes into.

One shell command typically yields several: the command itself, every path it touches, every host it may contact, every env var it reads or sets.

Variants (Non-exhaustive)§

This enum is marked as non-exhaustive
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.
§

Shell

Normalised argv of one (sub-)command.

Fields

§argv: Vec<String>

Program and arguments after quote removal.

§

Pipeline

A whole pipeline / list (a | b && c) with separators kept as tokens, so rules such as curl * | sh can match across sub-commands. Never carries a default verdict (see engine.rs).

Fields

§argv: Vec<String>

Words and separator tokens of the whole pipeline or list.

§

FsRead

Absolute path in slash-separated canonical form (~, ${project} and cwd already applied).

Fields

§path: String

Absolute path in canonical form.

§

FsWrite

A file write, create, delete or move.

Fields

§path: String

Absolute path in canonical form.

§

Net

Host name only (no scheme, no port).

Fields

§host: String

Lowercase host name.

§

Fetch

The host of a URL a fetch tool reads; matched by fetch and net rules.

Fields

§host: String

Lowercase host name.

§

NetWord

A shell word with no scheme that looks like a host, outside the arguments of a program that names hosts (ADR-025): it may be a JSON path or a method call (check_runs.0.id, app.run). Matched by net rules; when none matches, the policy’s catch-all decides it, not defaults.net.

Fields

§host: String

Lowercase host name.

§

WebSearch

A web search query; no rule list names it, so defaults decide it.

Fields

§query: String

The query as the tool gave it.

§

UnknownTool

A host tool the adapter cannot classify; only defaults decide it.

Fields

§host: String

The host’s id.

§tool: String

The tool name as the host sent it.

§

EnvRead

An environment variable read ($NAME, printenv NAME).

Fields

§name: String

Variable name.

§

EnvSet

An environment variable set (NAME=value, export NAME=…).

Fields

§name: String

Variable name.

§

McpTool

An MCP tool invocation.

Fields

§name: String

mcp__<server>__<tool>.

Implementations§

Source§

impl AtomicAction

Source

pub fn kind(&self) -> Kind

The rule kind this atom is matched against.

Source

pub fn describe(&self) -> String

Short human description used in reasons and audit lines.

Trait Implementations§

Source§

impl Clone for AtomicAction

Source§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

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

Performs copy-assignment from source. Read more
Source§

impl Debug for AtomicAction

Source§

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

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

impl<'de> Deserialize<'de> for AtomicAction

Source§

fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>
where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
Source§

impl Eq for AtomicAction

Source§

impl PartialEq for AtomicAction

Source§

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

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

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

Inequality operator !=. Read more
Source§

impl Serialize for AtomicAction

Source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more
Source§

impl StructuralPartialEq for AtomicAction

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> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,

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, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

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

fn try_from(value: U) -> Result<T, !>

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.