pub trait Atoms: Send + Sync {
// Provided methods
fn new_uuid(&self) -> Arc<str> { ... }
fn now_millis(&self) -> i64 { ... }
fn secret(&self, name: &str) -> Arc<str> { ... }
fn fetch(&self, request: &Request, stop: &Stop) -> Result<Reply, Failure> { ... }
}Expand description
The impure capabilities a host supplies, one method per effect atom.
Send + Sync because a compiled backend hands one to a worker that the runtime calls from a
sequencer task and a connection task alike, and a host that cannot survive that is not a host
for this runtime.
Provided Methods§
Sourcefn new_uuid(&self) -> Arc<str>
fn new_uuid(&self) -> Arc<str>
Mint an id — nondet. Called only where the checker has proved we are not inside a fold.
Sourcefn now_millis(&self) -> i64
fn now_millis(&self) -> i64
Read the wall clock — nondet, and forbidden inside a fold for the same reason uuid()
is: time is data on the envelope (§3.7).
Sourcefn secret(&self, name: &str) -> Arc<str>
fn secret(&self, name: &str) -> Arc<str>
Read a secret from the process environment — env, which no client tier discharges.
Sourcefn fetch(&self, request: &Request, stop: &Stop) -> Result<Reply, Failure>
fn fetch(&self, request: &Request, stop: &Stop) -> Result<Reply, Failure>
Make an outbound request — the runtime half of net.out(host).
stop is how a parallel: reaches a child that is blocked in the socket rather than in
the evaluator (crate::net::Stop). A host that answers without blocking ignores it; one
that talks to a peer watches it, and a caller that cannot be cancelled passes
crate::net::Stop::never.