Skip to main content

Crate libspecr

Crate libspecr 

Source
Expand description

libspecr is the standard library of specr lang.

Modules§

prelude
The items from this module are automatically imported.

Macros§

format
Wrapper around the std::format macro returning libspecr::String instead of std::string::String.
list
Construct a List.

Structs§

Align
This type is basically a copy of the Align type in the Rust compiler. See Align.
DynWrite
Garbage-collected data structure representing a write stream and implementing Copy.
Int
Garbage collected big integer that implements Copy and supports construction in const contexts.
IntDistribution
Uniformly samples a random non-negative Int
List
Garbage-collected Vec-like datastructure implementing Copy. Note that functions which seem to mutate the List, actually clone the list and allocate a new GcCow under the hood.
Map
Garbage-collected hash map implementing Copy. This implements Ord but the order is not meaningful; this is just so one can use BTreeMaps. In particular, the order might differ across two runs of the same program.
Name
Wrapper-type for names of any kind.
NdResult
Conceptually, this is a Nondet<Result<T, E>>.
Nondet
Non-determinism primitive. See Non-determinism.
Set
Garbage-collected hash set implementing Copy. This implements Ord but the order is not meaningful; this is just so one can use BTreeMaps. In particular, the order might differ across two runs of the same program.
Size
Size represents a non-negative number of bytes or bits.
String
Garbage-collected wrapper around std::string::String implementing Copy.

Enums§

NondetResidual
The Try::Residual for Nondet. This type is empty because Nondet has no residual as using the ? operator on a Nondet<T> can not fail. We can not use Infallible here since we must implement the Residual trait, which coherence blocks us from doing for foreign types.

Traits§

Distribution
A probability distribution over values of type T.
GcWrite
An object that fulfills both GcCompat and Write.
MonadicReturn
Satisfied by types that can be constructed from some inner types.
ToInt
Conversion to Int.

Functions§

pick
The pick function from the minirust spec. See Non-determinism.
predict
The predict function from the minirust spec. See Non-determinism.
ret
Wraps a value i as Some(i), Ok(i) or something similar of type T.

Derive Macros§

GcCompat