Struct ContractDeployer
pub struct ContractDeployer<'a, W> { /* private fields */ }Expand description
Builder for deploying new contract instances.
Created with a contract artifact and wallet reference. Use
ContractDeployer::deploy to produce a DeployMethod for a
specific set of constructor arguments.
Implementations§
§impl<'a, W> ContractDeployer<'a, W>where
W: Wallet,
impl<'a, W> ContractDeployer<'a, W>where
W: Wallet,
pub fn new(artifact: ContractArtifact, wallet: &'a W) -> ContractDeployer<'a, W>
pub fn new(artifact: ContractArtifact, wallet: &'a W) -> ContractDeployer<'a, W>
Create a new deployer for the given artifact and wallet.
pub const fn with_public_keys(self, keys: PublicKeys) -> ContractDeployer<'a, W>
pub const fn with_public_keys(self, keys: PublicKeys) -> ContractDeployer<'a, W>
Set the public keys for the deployed instance.
pub fn with_constructor_name(
self,
name: impl Into<String>,
) -> ContractDeployer<'a, W>
pub fn with_constructor_name( self, name: impl Into<String>, ) -> ContractDeployer<'a, W>
Set the constructor function name (defaults to "constructor").
pub fn deploy(self, args: Vec<AbiValue>) -> Result<DeployMethod<'a, W>, Error>
pub fn deploy(self, args: Vec<AbiValue>) -> Result<DeployMethod<'a, W>, Error>
Create a DeployMethod for the given constructor arguments.
Validates the selected initializer, when present. Contracts with no initializer are allowed as long as no constructor arguments are passed.
Trait Implementations§
Auto Trait Implementations§
impl<'a, W> Freeze for ContractDeployer<'a, W>
impl<'a, W> RefUnwindSafe for ContractDeployer<'a, W>where
W: RefUnwindSafe,
impl<'a, W> Send for ContractDeployer<'a, W>where
W: Sync,
impl<'a, W> Sync for ContractDeployer<'a, W>where
W: Sync,
impl<'a, W> Unpin for ContractDeployer<'a, W>
impl<'a, W> UnwindSafe for ContractDeployer<'a, W>where
W: RefUnwindSafe,
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
§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