Struct aleo_rust::snarkvm_types::Package
source · pub struct Package<N>where
N: Network,{ /* private fields */ }
Implementations§
source§impl<N> Package<N>where
N: Network,
impl<N> Package<N>where N: Network,
sourcepub fn is_build_required<A>(&self) -> boolwhere
A: Aleo<Network = N, BaseField = <N as Environment>::Field>,
pub fn is_build_required<A>(&self) -> boolwhere A: Aleo<Network = N, BaseField = <N as Environment>::Field>,
Returns true
if the package is stale or has not been built.
source§impl<N> Package<N>where
N: Network,
impl<N> Package<N>where N: Network,
sourcepub fn run<A, R>(
&self,
endpoint: Option<String>,
private_key: &PrivateKey<N>,
function_name: Identifier<N>,
inputs: &[Value<N>],
rng: &mut R
) -> Result<(Response<N>, Trace<N>), Error>where
A: Aleo<Network = N, BaseField = <N as Environment>::Field>,
R: Rng + CryptoRng,
pub fn run<A, R>( &self, endpoint: Option<String>, private_key: &PrivateKey<N>, function_name: Identifier<N>, inputs: &[Value<N>], rng: &mut R ) -> Result<(Response<N>, Trace<N>), Error>where A: Aleo<Network = N, BaseField = <N as Environment>::Field>, R: Rng + CryptoRng,
Runs a program function with the given inputs.
source§impl<N> Package<N>where
N: Network,
impl<N> Package<N>where N: Network,
sourcepub fn create(
directory: &Path,
program_id: &ProgramID<N>
) -> Result<Package<N>, Error>
pub fn create( directory: &Path, program_id: &ProgramID<N> ) -> Result<Package<N>, Error>
Creates a new package, at the given directory with the given program name.
sourcepub fn open(directory: &Path) -> Result<Package<N>, Error>
pub fn open(directory: &Path) -> Result<Package<N>, Error>
Opens the package at the given directory with the given program name.
sourcepub const fn program_id(&self) -> &ProgramID<N>
pub const fn program_id(&self) -> &ProgramID<N>
Returns the program ID.
sourcepub const fn manifest_file(&self) -> &Manifest<N>
pub const fn manifest_file(&self) -> &Manifest<N>
Returns the manifest file.
sourcepub const fn program_file(&self) -> &AleoFile<N>
pub const fn program_file(&self) -> &AleoFile<N>
Returns the program file.
sourcepub const fn program(&self) -> &ProgramCore<N, Instruction<N>, Command<N>>
pub const fn program(&self) -> &ProgramCore<N, Instruction<N>, Command<N>>
Returns the program.
sourcepub fn build_directory(&self) -> PathBuf
pub fn build_directory(&self) -> PathBuf
Returns the build directory.
sourcepub fn imports_directory(&self) -> PathBuf
pub fn imports_directory(&self) -> PathBuf
Returns the imports directory.
sourcepub fn get_process(&self) -> Result<Process<N>, Error>
pub fn get_process(&self) -> Result<Process<N>, Error>
Returns a new process for the package.
Auto Trait Implementations§
impl<N> RefUnwindSafe for Package<N>where N: RefUnwindSafe, <N as Environment>::Field: RefUnwindSafe, <N as Environment>::Projective: RefUnwindSafe, <N as Environment>::Scalar: RefUnwindSafe,
impl<N> Send for Package<N>
impl<N> Sync for Package<N>
impl<N> Unpin for Package<N>where N: Unpin, <N as Environment>::Field: Unpin, <N as Environment>::Projective: Unpin, <N as Environment>::Scalar: Unpin,
impl<N> UnwindSafe for Package<N>where N: UnwindSafe, <N as Environment>::Field: UnwindSafe, <N as Environment>::Projective: UnwindSafe, <N as Environment>::Scalar: UnwindSafe,
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