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,
Source§impl<N> Package<N>where
N: Network,
impl<N> Package<N>where
N: Network,
Sourcepub fn execute<A, R>(
&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>>), Error>
pub fn execute<A, R>( &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>>), Error>
Executes a program function with the given inputs.
Source§impl<N> Package<N>where
N: Network,
impl<N> Package<N>where
N: Network,
Sourcepub fn is_build_required<A>(&self) -> bool
pub fn is_build_required<A>(&self) -> bool
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,
private_key: &PrivateKey<N>,
function_name: Identifier<N>,
inputs: &[Value<N>],
rng: &mut R,
) -> Result<(Response<N>, Vec<CallMetrics<N>>), Error>
pub fn run<A, R>( &self, private_key: &PrivateKey<N>, function_name: Identifier<N>, inputs: &[Value<N>], rng: &mut R, ) -> Result<(Response<N>, Vec<CallMetrics<N>>), Error>
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> Freeze for Package<N>
impl<N> RefUnwindSafe for Package<N>where
<N as Environment>::Field: RefUnwindSafe,
N: 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 as Environment>::Field: Unpin,
N: Unpin,
<N as Environment>::Projective: Unpin,
<N as Environment>::Scalar: Unpin,
impl<N> UnwindSafe for Package<N>where
<N as Environment>::Field: UnwindSafe,
N: 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
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