Skip to main content

Module marshal

Module marshal 

Source
Expand description

Conversions between Rust values and Lean objects, used by the generated public functions.

ToLean turns a Rust value into an owned boxed object; FromLean reads a Rust value from a borrowed boxed object. Containers whose Rust type does not determine the Lean type (Vec<T> is both List and Array) are converted by the functions of this module with a conversion of the elements.

Structs§

Int
A Lean Int: an integer of arbitrary precision.
Nat
A Lean Nat: a natural number of arbitrary precision.
OutOfRange
The error of a conversion of a Nat or Int into a Rust integer that cannot hold it.

Traits§

FromLean
Conversion of a Lean object into a Rust value.
ToLean
Conversion of a Rust value into a Lean object.

Functions§

array_from_lean⚠
A Vec from a borrowed Array α.
array_to_lean⚠
Array α from a Vec.
char_of_u32
A Lean Char (always a Unicode scalar value).
except_from_lean⚠
A Result from a borrowed Except ε α.
except_to_lean⚠
Except ε α (error is constructor 0, ok is 1).
fin_from_lean⚠
The usize of a borrowed Fin n.
fin_to_lean⚠
Fin n from a usize; panics when i is not below n.
io_error_to_std⚠
The std::io::Error of the borrowed IO.Error e, with the message msg (an owned String object: IO.Error.toString e).
list_from_lean⚠
A Vec from a borrowed List α.
list_to_lean⚠
List α from a Vec.
option_from_lean⚠
An Option from a borrowed Option α.
option_to_lean⚠
Option α.
prod_from_lean⚠
A tuple from a borrowed α × β.
prod_to_lean⚠
α × β.