Skip to main content

SandboxLimits

Struct SandboxLimits 

Source
pub struct SandboxLimits {
    pub arm: Option<SandboxArm>,
    pub container: Option<ContainerLimits>,
    pub shell: bool,
    pub interpreter: Interpreter,
    pub fuel: u64,
    pub mounts: Vec<Address>,
    pub env_passthrough: Vec<EnvVarName>,
    pub trusted: Vec<ServerLabel>,
}
Expand description

What a run’s execution boundary allows. Resolved as one value rather than field by field: a layer that speaks about the sandbox speaks about all of it, so an under-specified layer can only ever reduce what a run may do, never silently grant something the layer above it never mentioned.

Host facts are deliberately absent — where the Python artifact lives and which shell binary exists belong to the machine, not to the city, and a city carried to another machine must not carry its paths.

Fields§

§arm: Option<SandboxArm>

A named arm refuses when unavailable; absence preserves the platform default.

§container: Option<ContainerLimits>

Explicit container policy; absence uses the existing platform confinement.

§shell: bool

Whether the shell arm may be offered at all. Off by default: a shell line is the one arm whose reach cannot be read off its arguments.

§interpreter: Interpreter

Which interpreter the shell arm runs a line under: a name, never a path.

§fuel: u64

Instruction budget for one sandboxed call.

§mounts: Vec<Address>

Extra readable paths, relative to the city root. The write domain is decided elsewhere; this only widens what may be read.

§env_passthrough: Vec<EnvVarName>

Environment variable names a child process started by this scope may inherit, on top of the four every run gets.

Declared name by name rather than widened once for everybody: a build chain that needs to find its linker needs a handful of names this machine happens to set, and a longer built-in list would hand every run in every city whatever those names hold.

§trusted: Vec<ServerLabel>

Which connector servers this floor lets reach effects nothing in the city can take back — today, this machine’s own desktop.

Named server by server, and empty by default, for the reason env_passthrough is: a run that presses keys on somebody’s keyboard is doing something no checkpoint puts back, so the floor says which connector may, in the one file a person edits.

Implementations§

Source§

impl SandboxLimits

Source

pub fn selected_arm(&self) -> Result<Option<SandboxArm>, AxError>

Resolves the explicit sandbox choice, rejecting contradictory input.

§Errors

Refuses a selected container without limits or limits on another explicit arm.

Source

pub fn trusts(&self, label: &ServerLabel) -> bool

Whether this floor lets label reach what nothing here can undo. The one reader of the trusted list, so the answer cannot be spelled two ways.

Trait Implementations§

Source§

impl Clone for SandboxLimits

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 SandboxLimits

Source§

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

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

impl Default for SandboxLimits

Source§

fn default() -> Self

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

impl<'de> Deserialize<'de> for SandboxLimits

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 SandboxLimits

Source§

impl PartialEq for SandboxLimits

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 SandboxLimits

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 SandboxLimits

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.