Struct snarkvm_debug::package::Package
source · pub struct Package<N: Network> { /* private fields */ }Implementations§
source§impl<N: Network> Package<N>
impl<N: Network> Package<N>
sourcepub fn execute<A: Aleo<Network = N, BaseField = N::Field>, R: Rng + CryptoRng>(
&self,
endpoint: String,
private_key: &PrivateKey<N>,
function_name: Identifier<N>,
inputs: &[Value<N>],
rng: &mut R
) -> Result<(Response<N>, Execution<N>, Vec<CallMetrics<N>>)>
pub fn execute<A: Aleo<Network = N, BaseField = N::Field>, R: Rng + CryptoRng>( &self, endpoint: String, private_key: &PrivateKey<N>, function_name: Identifier<N>, inputs: &[Value<N>], rng: &mut R ) -> Result<(Response<N>, Execution<N>, Vec<CallMetrics<N>>)>
Executes a program function with the given inputs.
source§impl<N: Network> Package<N>
impl<N: Network> Package<N>
sourcepub fn is_build_required<A: Aleo<Network = N, BaseField = N::Field>>(
&self
) -> bool
pub fn is_build_required<A: Aleo<Network = N, BaseField = N::Field>>( &self ) -> bool
Returns true if the package is stale or has not been built.
source§impl<N: Network> Package<N>
impl<N: Network> Package<N>
sourcepub fn run<A: Aleo<Network = N, BaseField = N::Field>, R: Rng + CryptoRng>(
&self,
private_key: &PrivateKey<N>,
function_name: Identifier<N>,
inputs: &[Value<N>],
rng: &mut R
) -> Result<(Response<N>, Vec<CallMetrics<N>>)>
pub fn run<A: Aleo<Network = N, BaseField = N::Field>, R: Rng + CryptoRng>( &self, private_key: &PrivateKey<N>, function_name: Identifier<N>, inputs: &[Value<N>], rng: &mut R ) -> Result<(Response<N>, Vec<CallMetrics<N>>)>
Runs a program function with the given inputs.
source§impl<N: Network> Package<N>
impl<N: Network> Package<N>
sourcepub fn create(directory: &Path, program_id: &ProgramID<N>) -> Result<Self>
pub fn create(directory: &Path, program_id: &ProgramID<N>) -> Result<Self>
Creates a new package, at the given directory with the given program name.
sourcepub fn open(directory: &Path) -> Result<Self>
pub fn open(directory: &Path) -> Result<Self>
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 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>>
pub fn get_process(&self) -> Result<Process<N>>
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