Skip to main content

Reach

Enum Reach 

Source
pub enum Reach {
    Here,
    Subprocess {
        command: String,
        args: Vec<String>,
        cwd: Option<PathBuf>,
        env: BTreeMap<String, String>,
        timeout_ms: u64,
        persistent: bool,
    },
    Wasm {
        module: PathBuf,
        fuel: Option<u64>,
    },
    Remote {
        endpoint: String,
        timeout_ms: u64,
    },
}
Expand description

How this process gets to an environment.

Separate from the environment itself: it is the road, not the destination.

Variants§

§

Here

The environment is this process.

Implementations here are Rust functions compiled in, or bodies the interpreter walks. Nothing is serialized and nothing is spawned.

§

Subprocess

A child process, started when needed and spoken to over its standard streams.

Fields

§command: String

The program to run.

§args: Vec<String>

Its arguments.

§cwd: Option<PathBuf>

Where to run it, relative to the manifest that declared it.

§env: BTreeMap<String, String>

Environment variables to set.

§timeout_ms: u64

How long to wait before giving up.

§persistent: bool

Keep the process alive between calls.

Starting an interpreter costs more than most calls do — around twenty milliseconds for Python — so a program calling repeatedly pays that over and over for nothing. A worker pays it once.

The cost is that state now survives between calls, which is exactly what one process per call was free of. Off by default for that reason: a module that holds nothing between calls says so.

§

Wasm

A WebAssembly module instantiated in this process.

The only environment that is actually a sandbox: a guest gets memory and nothing else — no files, no sockets, no clock — and runs on a budget, so a proof that never finishes stops rather than taking this process with it. There is no operating system process to kill here, which is why the budget matters more than a timeout would.

Fields

§module: PathBuf

The module to load.

§fuel: Option<u64>

How much work the guest may do before it is stopped.

§

Remote

Something already running that this process talks to.

Fields

§endpoint: String

Where to find it.

§timeout_ms: u64

How long to wait before giving up.

Implementations§

Source§

impl Reach

Source

pub fn kind(&self) -> &'static str

A short name for this way of reaching an environment.

Source

pub fn timeout_ms(&self) -> Option<u64>

How long to wait for an answer, where waiting is a thing that happens.

Source

pub fn is_persistent(&self) -> bool

Whether the process is kept alive between calls.

Source

pub fn overhead(&self) -> u8

Roughly what it costs to get there, ascending.

Used only to break ties between proofs that are otherwise equally good, on the reasoning that not leaving the process beats leaving it. A worker already running costs less to reach than one that has to be started.

Trait Implementations§

Source§

impl Clone for Reach

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 Reach

Source§

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

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

impl<'de> Deserialize<'de> for Reach

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 PartialEq for Reach

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 Reach

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 Reach

Auto Trait Implementations§

§

impl Forget for Reach

§

impl Freeze for Reach
where *const u8 is !null: Freeze, PhantomData<u8>: Freeze, PhantomData<String>: Freeze, *const LeafNode<String, String> is !null: Freeze, PhantomData<(Owned, LeafOrInternal)>: Freeze, PhantomData<Box<(String, String)>>: Freeze,

§

impl Move for Reach

§

impl RefUnwindSafe for Reach

§

impl Send for Reach
where RawVecInner: Send, NodeRef<Owned, String, String, LeafOrInternal>: Send, BoxRaw<(String, String)>: Send,

§

impl Sync for Reach
where RawVecInner: Sync, NodeRef<Owned, String, String, LeafOrInternal>: Sync, BoxRaw<(String, String)>: Sync,

§

impl Unpin for Reach
where *const u8 is !null: Unpin, *const LeafNode<String, String> is !null: Unpin, Box<(String, String)>: Unpin,

§

impl UnsafeUnpin for Reach

§

impl UnwindSafe for Reach
where RawVecInner: UnwindSafe, BTreeMap<String, String>: UnwindSafe,

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.