pub struct Program {
pub name: Symbol,
pub data: ProgramData,
pub dependencies: IndexSet<Dependency>,
pub is_test: bool,
}
Expand description
Information about an Aleo program.
Fields§
§name: Symbol
§data: ProgramData
§dependencies: IndexSet<Dependency>
§is_test: bool
Implementations§
Source§impl Program
impl Program
Sourcepub fn from_path<P: AsRef<Path>>(name: Symbol, path: P) -> Result<Self>
pub fn from_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_path_impl(name: Symbol, path: &Path) -> Result<Self>
Sourcepub fn from_path_test<P: AsRef<Path>>(
source_path: P,
main_program: Dependency,
) -> Result<Self>
pub fn from_path_test<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_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,
home_path: P,
network: NetworkName,
endpoint: &str,
no_cache: bool,
) -> Result<Self>
pub fn fetch<P: AsRef<Path>>( name: Symbol, 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
.
fn fetch_impl( name: Symbol, 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