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. - OutOf
Range - The error of a conversion of a
NatorIntinto a Rust integer that cannot hold it.
Traits§
- From
Lean - Conversion of a Lean object into a Rust value.
- ToLean
- Conversion of a Rust value into a Lean object.
Functions§
- array_
from_ ⚠lean - A
Vecfrom a borrowedArray α. - array_
to_ ⚠lean Array αfrom aVec.- char_
of_ u32 - A Lean
Char(always a Unicode scalar value). - except_
from_ ⚠lean - A
Resultfrom a borrowedExcept ε α. - except_
to_ ⚠lean Except ε α(erroris constructor 0,okis 1).- fin_
from_ ⚠lean - The
usizeof a borrowedFin n. - fin_
to_ ⚠lean Fin nfrom ausize; panics wheniis not belown.- io_
error_ ⚠to_ std - The
std::io::Errorof the borrowedIO.Errore, with the messagemsg(an ownedStringobject:IO.Error.toString e). - list_
from_ ⚠lean - A
Vecfrom a borrowedList α. - list_
to_ ⚠lean List αfrom aVec.- option_
from_ ⚠lean - An
Optionfrom a borrowedOption α. - option_
to_ ⚠lean Option α.- prod_
from_ ⚠lean - A tuple from a borrowed
α × β. - prod_
to_ ⚠lean α × β.