Skip to main content

Builder

Struct Builder 

Source
pub struct Builder { /* private fields */ }
Expand description

Configures and runs the build step.

Implementations§

Source§

impl Builder

Source

pub fn new() -> Self

A builder for the crate of the running build script (CARGO_MANIFEST_DIR, OUT_DIR, CARGO_PKG_NAME).

Source

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.

Source

pub fn crate_ident(&self) -> String

Source

pub fn cache_dir(&self) -> PathBuf

Source

pub fn lean_dir(&self) -> PathBuf

Source

pub fn lock_path(&self) -> PathBuf

The lockfile of the crate.

Source

pub fn csimp_path(&self) -> PathBuf

The @[csimp] replacements cargo leanfran check writes.

Source

pub fn csimp_key(&self) -> String

The part of every cache key that depends on the @[csimp] replacements.

Source

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.

Source

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).

Source

pub fn scan_items(&self) -> Result<CrateItems, Error>

The modelled functions, opaque functions, uses and item hashes of src/**/*.rs.

Source

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

pub fn scan(&self) -> Result<(Vec<Block>, Vec<PathBuf>), Error>

The lean! blocks of src/**/*.rs and the scanned files.

Source§

impl Builder

Source

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.

Trait Implementations§

Source§

impl Default for Builder

Source§

fn default() -> Self

Returns the “default value” for a type. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.