Skip to main content

Module gates

Module gates 

Source
Expand description

Runtime checks of computed targets in straight-line code: file paths, HTTP URLs, Redis keys.

fs::write(&a, ..) and fs::read(&b) conflict when the macro cannot tell a from b. When both paths can be evaluated at the start of the region (they are total and depend on nothing the region binds or anything mut), the region is scheduled as if differently written paths named different files, and each dependency that drops is kept at run time instead: the paths are compared at the start of the region, and when they overlap, the later chain waits for the earlier one to end before it starts ([crate::__private]’s Gate).

The same holds for an HTTP request’s URL (request(Method::PUT, url)), compared by path segments as files are, and for a Redis command’s key (redis::cmd("SET").arg(k)), compared for equality. A URL or key whose type has no Display cannot be compared, and always counts as overlapping.

Structs§

Compare 🔒
How generated code compares targets at run time.
Gate 🔒
A gate: chain waits starts only after chain on ends, when cond (a bool computed at the start of the region) is true.

Enums§

How 🔒
How two targets of one kind are compared at run time.

Functions§

how 🔒
How an effect’s target can be compared at run time, if it can.
relax 🔒
The relaxed schedule, the gates that keep it sequentially consistent, and the statements that compute their conditions; None when there is nothing to gain or a gate cannot be placed.
widen 🔒
A target that may alias any other (Expr is compared with nothing), shown as before.
widen_files 🔒
Under owned_files, two path spellings may name one file (a symlink, a hard link): the nodes with every file target widened to any file. Planning these orders every pair of file effects; relax then compares the paths that differ by text at run time, by identity.

Type Aliases§

Pairs 🔒
Pairs of keys, one from each of two statements, compared at run time.