Contracts
std/contracts supplies the explicit, higher-level protocols that do not belong to the compiler-owned prelude. It has no runtime state, allocation, I/O, FFI or platform dependency.
import { From, TryFrom, Collection, Stack } from "contracts";Conversion
From<T>.fromValue(value)performs an explicit infallible construction.Into<T>.intoValue(value)consumesSelfand producesT.TryFrom<T>.tryFromValue(value)returnsResult<Self, Self.Error>.TryInto<T>.tryIntoValue(value)consumesSelfand returnsResult<T, Self.Error>.Default.defaultValue()constructs the type's explicit default.
These are static requirements. Generic code calls them through the type parameter:
fn convert<T, U: From<T>>(value: T): U {
return U.fromValue(value);
}The compiler seals the type-parameter ordinal plus exact contract/member identity and resolves the concrete inherent implementation during monomorphization. There is no runtime interface object or string lookup.
Conversion contracts do not add implicit coercions. Vex's implicit conversion rules remain constructor-driven and compiler-checked.
Collections
Collection<T>defineslen,isEmptyandclear.Growabledefines target-native capacity, minimum-capacityreserve, andshrinkToFit.Stack<T>composesCollection<T> + Growableand provides owning LIFO mutation plus borrowedpeek/peekMut.Queue<T>composesCollection<T> + Growableand provides owning FIFO mutation plus borrowedfront/frontMut.Indexable<T, Idx>composesCollection<T>and provides borrowed read, mutable borrow and replacement.
All counts and capacities use usize. Read APIs borrow elements rather than forcing clones.
Other exports
Ordering is the package-owned Less | Equal | Greater enum. PackedType<T> describes block encoders/decoders suitable for SIR CPU SIMD and GPU dispatch.
Operators, formatting, lifecycle, ownership, Iterator, IntoIterator and safety capabilities are canonical prelude contracts. They are intentionally not re-exported here.
Verification
The 2026-08-25 checkpoint reported warning-denied lint and the complete fixture matrix at O0 and O3. That dated result does not identify or qualify a later release binary. See the repository's dated contracts sign-off for the compiler and package evidence.