pub struct Builder { /* private fields */ }Expand description
Configures and runs the build step.
Implementations§
Source§impl Builder
impl Builder
Sourcepub fn new() -> Self
pub fn new() -> Self
A builder for the crate of the running build script (CARGO_MANIFEST_DIR, OUT_DIR,
CARGO_PKG_NAME).
Sourcepub fn with_dirs(
manifest_dir: impl Into<PathBuf>,
out_dir: impl Into<PathBuf>,
crate_name: impl Into<String>,
) -> Self
pub fn with_dirs( manifest_dir: impl Into<PathBuf>, out_dir: impl Into<PathBuf>, crate_name: impl Into<String>, ) -> Self
A builder for an explicit crate directory, output directory and crate name.
pub fn crate_ident(&self) -> String
pub fn cache_dir(&self) -> PathBuf
pub fn lean_dir(&self) -> PathBuf
Sourcepub fn csimp_path(&self) -> PathBuf
pub fn csimp_path(&self) -> PathBuf
The @[csimp] replacements cargo leanfran check writes.
Sourcepub fn csimp_key(&self) -> String
pub fn csimp_key(&self) -> String
The part of every cache key that depends on the @[csimp] replacements.
Sourcepub fn compile(&self) -> Result<(), Error>
pub fn compile(&self) -> Result<(), Error>
Generates the Rust modules of all lean! blocks of the crate into OUT_DIR, and
compares the modelled functions with the lockfile.
Sourcepub fn generate_cache(
&self,
blocks: &[Block],
select: impl Fn(&Block) -> bool,
) -> Result<(), Error>
pub fn generate_cache( &self, blocks: &[Block], select: impl Fn(&Block) -> bool, ) -> Result<(), Error>
Generates the cache entries of the blocks that select accepts and that are not
cached (with lake build and leanfran module generate).
Sourcepub fn scan_items(&self) -> Result<CrateItems, Error>
pub fn scan_items(&self) -> Result<CrateItems, Error>
The modelled functions, opaque functions, uses and item hashes of src/**/*.rs.
Sourcepub fn spec_hashes(
&self,
blocks: &[Block],
items: &CrateItems,
) -> Result<BTreeMap<String, String>, Error>
pub fn spec_hashes( &self, blocks: &[Block], items: &CrateItems, ) -> Result<BTreeMap<String, String>, Error>
The current hashes of the specs: sha256:<cache key> of the blocks (without the
@[csimp] replacements) by module path, and the hashes of the other functions by unit
name.
Source§impl Builder
impl Builder
Sourcepub fn opaque_models(
&self,
items: &CrateItems,
) -> Result<Vec<OpaqueModel>, Error>
pub fn opaque_models( &self, items: &CrateItems, ) -> Result<Vec<OpaqueModel>, Error>
The opaque functions whose model Aeneas lists in FunsExternal_Template.lean, when
lean/External.lean defines it.