Skip to main content

Crate trust_std

Crate trust_std 

Source
Expand description

Named-argument shims over std.

Each wrapper exists so Trust callers can write call sites with name: value syntax: fs::read_to_string(path: p) instead of the positional std::fs::read_to_string(p). The wrappers carry no logic; they exist purely to make parameter names part of the signature for Trust’s named-args lowering pass.

This crate is #![strict]-marked as of RT-44. The build-time index STD_SIGNATURES (in trust-lower) used to be generated by parsing this file directly with syn, which would have broken the moment the file used any Trust-specific syntax. The current design generates a checked-in manifest at crates/trust-std/std-signatures.txt via cargo xtask gen-std-signatures (which lowers the source first, then parses), and trust-lower/build.rs reads that manifest. CI enforces freshness with cargo xtask gen-std-signatures --check.

Modules§

collections
env
fs
net
process
string
sync
thread
time
vec

Macros§

newtype
Declare a distinct newtype in one line — the ergonomic fix for R0017 (no-same-type-params). Wrapping each same-typed parameter in its own newtype turns a silent argument swap into a compile error.