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: bool
Implementations§
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
.
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
.
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.
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,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§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