pub struct Program {
pub name: Symbol,
pub data: ProgramData,
pub edition: Option<u16>,
pub dependencies: IndexSet<Dependency>,
pub is_local: bool,
pub is_test: bool,
}Expand description
Information about an Aleo program.
Fields§
§name: Symbol§data: ProgramData§edition: Option<u16>§dependencies: IndexSet<Dependency>§is_local: bool§is_test: boolImplementations§
Source§impl Program
impl Program
Sourcepub fn from_aleo_path<P: AsRef<Path>>(
name: Symbol,
path: P,
map: &IndexMap<Symbol, Dependency>,
) -> Result<Self>
pub fn from_aleo_path<P: AsRef<Path>>( name: Symbol, path: P, map: &IndexMap<Symbol, Dependency>, ) -> Result<Self>
Given the location path of a .aleo file, read the filesystem
to obtain a Program.
fn from_aleo_path_impl( name: Symbol, path: &Path, map: &IndexMap<Symbol, Dependency>, ) -> Result<Self>
Sourcepub fn from_package_path<P: AsRef<Path>>(name: Symbol, path: P) -> Result<Self>
pub fn from_package_path<P: AsRef<Path>>(name: Symbol, path: P) -> Result<Self>
Given the location path of a local Leo package, read the filesystem
to obtain a Program.
fn from_package_path_impl(name: Symbol, path: &Path) -> Result<Self>
Sourcepub fn from_test_path<P: AsRef<Path>>(
source_path: P,
main_program: Dependency,
) -> Result<Self>
pub fn from_test_path<P: AsRef<Path>>( source_path: P, main_program: Dependency, ) -> Result<Self>
Given the path to the source file of a test, create a Program.
Unlike Program::from_package_path, the path is to the source file,
and the name of the program is determined from the filename.
main_program must be provided since every test is dependent on it.
fn from_path_test_impl( source_path: &Path, main_program: Dependency, ) -> Result<Self>
Sourcepub fn fetch<P: AsRef<Path>>(
name: Symbol,
edition: Option<u16>,
home_path: P,
network: NetworkName,
endpoint: &str,
no_cache: bool,
) -> Result<Self>
pub fn fetch<P: AsRef<Path>>( name: Symbol, edition: Option<u16>, home_path: P, network: NetworkName, endpoint: &str, no_cache: bool, ) -> Result<Self>
Given an Aleo program on a network, fetch it to build a Program.
If no edition is found, the latest edition is pulled from the network.
fn fetch_impl( name: Symbol, edition: Option<u16>, home_path: &Path, network: NetworkName, endpoint: &str, no_cache: bool, ) -> Result<Self>
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Program
impl RefUnwindSafe for Program
impl Send for Program
impl Sync for Program
impl Unpin for Program
impl UnwindSafe for Program
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
Mutably borrows from an owned value. Read more
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>
Converts
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>
Converts
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