pub struct Package {
pub base_directory: PathBuf,
pub programs: Vec<Program>,
pub manifest: Manifest,
}Expand description
A Leo package.
Fields§
§base_directory: PathBufThe directory on the filesystem where the package is located, canonicalized.
programs: Vec<Program>A topologically sorted list of all programs in this package, whether dependencies or the main program.
Any program’s dependent program will appear before it, so that compiling them in order should give access to all stubs necessary to compile each program.
manifest: ManifestThe manifest file of this package.
Implementations§
Source§impl Package
impl Package
pub fn outputs_directory(&self) -> PathBuf
pub fn imports_directory(&self) -> PathBuf
pub fn build_directory(&self) -> PathBuf
pub fn source_directory(&self) -> PathBuf
pub fn tests_directory(&self) -> PathBuf
Sourcepub fn initialize<P: AsRef<Path>>(
package_name: &str,
path: P,
) -> Result<PathBuf>
pub fn initialize<P: AsRef<Path>>( package_name: &str, path: P, ) -> Result<PathBuf>
Create a Leo package by the name package_name in a subdirectory of path.
fn initialize_impl(package_name: &str, path: &Path) -> Result<PathBuf>
Sourcepub fn from_directory_no_graph<P: AsRef<Path>, Q: AsRef<Path>>(
path: P,
home_path: Q,
network: Option<NetworkName>,
endpoint: Option<&str>,
) -> Result<Self>
pub fn from_directory_no_graph<P: AsRef<Path>, Q: AsRef<Path>>( path: P, home_path: Q, network: Option<NetworkName>, endpoint: Option<&str>, ) -> Result<Self>
Examine the Leo package at path to create a Package, but don’t find dependencies.
This may be useful if you just need other information like the manifest file.
Sourcepub fn from_directory<P: AsRef<Path>, Q: AsRef<Path>>(
path: P,
home_path: Q,
no_cache: bool,
no_local: bool,
network: Option<NetworkName>,
endpoint: Option<&str>,
) -> Result<Self>
pub fn from_directory<P: AsRef<Path>, Q: AsRef<Path>>( path: P, home_path: Q, no_cache: bool, no_local: bool, network: Option<NetworkName>, endpoint: Option<&str>, ) -> Result<Self>
Examine the Leo package at path to create a Package, including all its dependencies,
obtaining dependencies from the file system or network and topologically sorting them.
Sourcepub fn from_directory_with_tests<P: AsRef<Path>, Q: AsRef<Path>>(
path: P,
home_path: Q,
no_cache: bool,
no_local: bool,
network: Option<NetworkName>,
endpoint: Option<&str>,
) -> Result<Self>
pub fn from_directory_with_tests<P: AsRef<Path>, Q: AsRef<Path>>( path: P, home_path: Q, no_cache: bool, no_local: bool, network: Option<NetworkName>, endpoint: Option<&str>, ) -> Result<Self>
Examine the Leo package at path to create a Package, including all its dependencies
and its tests, obtaining dependencies from the file system or network and topologically sorting them.
pub fn test_files(&self) -> impl Iterator<Item = PathBuf>
pub fn import_files(&self) -> impl Iterator<Item = PathBuf>
fn files_with_extension( path: &Path, extension: &'static str, ) -> impl Iterator<Item = PathBuf>
fn from_directory_impl( path: &Path, home_path: &Path, build_graph: bool, with_tests: bool, no_cache: bool, no_local: bool, network: Option<NetworkName>, endpoint: Option<&str>, ) -> Result<Self>
fn graph_build( home_path: &Path, network: Option<NetworkName>, endpoint: Option<&str>, main_program: &Dependency, new: Dependency, map: &mut IndexMap<Symbol, (Dependency, Program)>, graph: &mut DiGraph<Symbol>, no_cache: bool, no_local: bool, ) -> Result<()>
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Package
impl RefUnwindSafe for Package
impl Send for Package
impl Sync for Package
impl Unpin for Package
impl UnwindSafe for Package
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more