Crate forc_pkg

source ·
Expand description

Building, locking, fetching and updating sway projects as Forc packages.

A forc package represents a Sway project with a Forc.toml manifest file declared at its root. The project should consist of one or more Sway modules under a src directory. It may also declare a set of forc package dependencies within its manifest.

Re-exports

Modules

Structs

Enums

Constants

  • The name of the constant holding the contract’s id.
  • The suffix that helps identify the file which contains the hash of the binary file created when scripts are built_package.
  • The suffix that helps identify the file which contains the root hash of the binary file created when predicates are built_package.

Functions

  • Build an entire forc package and return the built_package output.
  • Builds a project with given BuildOptions.
  • Compile the entire forc package and return the lexed, parsed and typed programs of the dependancies and project. The final item in the returned vector is the project.
  • The pkg::Graph is of a -> b where a depends on b. We can determine compilation order by performing a toposort of the graph with reversed weights. The resulting order ensures all dependencies are always compiled before their dependents.
  • Compiles the given package.
  • Compiles the package to an AST.
  • Returns the ContractId of a built_package contract with specified salt.
  • Builds the dependency namespace for the package at the given node index within the graph.
  • Fetch the repo at the given git package’s URL and checkout the pinned commit.
  • Produce a unique ID for a particular fetch pass.
  • The same as find_within, but returns the package’s project directory.
  • Attempt to find a Forc.toml with the given project name within the given directory.
  • Format an error message if a given URL fails to produce a working node.
  • The path to which a git package commit should be checked out.
  • Format an error message for an absent Forc.toml.
  • Returns a parsed AST from the supplied PackageManifestFile
  • Format an error message for failed parsing of a manifest.
  • Pin the given git-sourced package.
  • Given a forc_pkg::BuildProfile, produce the necessary sway_core::BuildConfig required for compilation.
  • Format an error message if an incorrect program type is present.

Type Definitions