Struct ethcontract::contract::DeployBuilder

source ·
pub struct DeployBuilder<T, I>
where T: Transport, I: Deploy<T>,
{ /* private fields */ }
Expand description

Builder for specifying options for deploying a linked contract.

Implementations§

source§

impl<T, I> DeployBuilder<T, I>
where T: Transport, I: Deploy<T>,

source

pub fn new<P>( web3: Web3<T>, context: I::Context, params: P ) -> Result<Self, DeployError>
where P: Tokenize,

Create a new deploy builder from a web3 provider, contract data and deployment (constructor) parameters.

source

pub fn from(self, value: Account) -> Self

Specify the signing method to use for the transaction, if not specified the the transaction will be locally signed with the default user.

source

pub fn gas(self, value: U256) -> Self

Secify amount of gas to use, if not specified then a gas estimate will be used.

source

pub fn gas_price(self, value: GasPrice) -> Self

Specify the gas price to use, if not specified then the estimated gas price will be used.

source

pub fn value(self, value: U256) -> Self

Specify what how much ETH to transfer with the transaction, if not specified then no ETH will be sent.

source

pub fn nonce(self, value: U256) -> Self

Specify the nonce for the transation, if not specified will use the current transaction count for the signing account.

source

pub fn confirmations(self, value: usize) -> Self

Specify the number of confirmations to wait for when confirming the transaction, if not specified will wait for the transaction to be mined without any extra confirmations.

source

pub fn into_inner(self) -> TransactionBuilder<T>

Extract inner TransactionBuilder from this DeployBuilder. This exposes TransactionBuilder only APIs.

source

pub async fn deploy(self) -> Result<I, DeployError>

Sign (if required) and execute the transaction. Returns the transaction hash that can be used to retrieve transaction information.

Trait Implementations§

source§

impl<T, I> Clone for DeployBuilder<T, I>
where T: Transport + Clone, I: Deploy<T> + Clone, I::Context: Clone,

source§

fn clone(&self) -> DeployBuilder<T, I>

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl<T, I> Debug for DeployBuilder<T, I>
where T: Transport + Debug, I: Deploy<T> + Debug, I::Context: Debug,

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

§

impl<T, I> Freeze for DeployBuilder<T, I>
where <I as Deploy<T>>::Context: Freeze, T: Freeze,

§

impl<T, I> RefUnwindSafe for DeployBuilder<T, I>

§

impl<T, I> Send for DeployBuilder<T, I>
where <I as Deploy<T>>::Context: Send, T: Send, I: Send,

§

impl<T, I> Sync for DeployBuilder<T, I>
where <I as Deploy<T>>::Context: Sync, T: Sync, I: Sync,

§

impl<T, I> Unpin for DeployBuilder<T, I>
where <I as Deploy<T>>::Context: Unpin, T: Unpin, I: Unpin,

§

impl<T, I> UnwindSafe for DeployBuilder<T, I>
where <I as Deploy<T>>::Context: UnwindSafe, T: UnwindSafe, I: UnwindSafe,

Blanket Implementations§

source§

impl<T> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T> Instrument for T

source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
source§

impl<T, U> Into<U> for T
where U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<T> ToOwned for T
where T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

source§

fn vzip(self) -> V

source§

impl<T> WithSubscriber for T

source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more