pub struct DeployBuilder<'a> { /* private fields */ }Expand description
A builder for constructing a Deploy.
Implementations§
Source§impl<'a> DeployBuilder<'a>
impl<'a> DeployBuilder<'a>
Sourcepub fn new<C: Into<String>>(
chain_name: C,
session: ExecutableDeployItem,
secret_key: &'a SecretKey,
) -> Self
pub fn new<C: Into<String>>( chain_name: C, session: ExecutableDeployItem, secret_key: &'a SecretKey, ) -> Self
Returns a new DeployBuilder.
§Note
Before calling build, you must ensure that payment code is provided by
either calling with_standard_payment or
with_payment.
Sourcepub fn new_transfer<C: Into<String>, A: Into<U512>>(
chain_name: C,
amount: A,
maybe_source: Option<URef>,
target: TransferTarget,
maybe_transfer_id: Option<u64>,
secret_key: &'a SecretKey,
) -> Self
pub fn new_transfer<C: Into<String>, A: Into<U512>>( chain_name: C, amount: A, maybe_source: Option<URef>, target: TransferTarget, maybe_transfer_id: Option<u64>, secret_key: &'a SecretKey, ) -> Self
Returns a new DeployBuilder with session code suitable for a transfer.
If maybe_source is None, the account’s main purse is used as the source of the transfer.
§Note
Before calling build, you must ensure that payment code is provided by
either calling with_standard_payment or
with_payment.
Sourcepub fn with_standard_payment<A: Into<U512>>(self, amount: A) -> Self
pub fn with_standard_payment<A: Into<U512>>(self, amount: A) -> Self
Sets the payment in the Deploy to a standard payment with the given amount.
Sourcepub fn with_payment(self, payment: ExecutableDeployItem) -> Self
pub fn with_payment(self, payment: ExecutableDeployItem) -> Self
Sets the payment in the Deploy.
Sourcepub fn with_account(self, account: PublicKey) -> Self
pub fn with_account(self, account: PublicKey) -> Self
Sets the account in the Deploy.
If not provided, the public key derived from the secret key used in the DeployBuilder will
be used as the account in the Deploy.
Sourcepub fn with_timestamp(self, timestamp: Timestamp) -> Self
pub fn with_timestamp(self, timestamp: Timestamp) -> Self
Sets the timestamp in the Deploy.
If not provided, the timestamp will be set to the time when the DeployBuilder was
constructed.
Sourcepub fn with_ttl(self, ttl: TimeDiff) -> Self
pub fn with_ttl(self, ttl: TimeDiff) -> Self
Sets the ttl (time-to-live) in the Deploy.
If not provided, the ttl will be set to Deploy::DEFAULT_TTL.
Sourcepub fn build(self) -> Result<Deploy, Error>
pub fn build(self) -> Result<Deploy, Error>
Returns the new Deploy, or an error if neither
with_standard_payment nor
with_payment were previously called.
Auto Trait Implementations§
impl<'a> Freeze for DeployBuilder<'a>
impl<'a> RefUnwindSafe for DeployBuilder<'a>
impl<'a> Send for DeployBuilder<'a>
impl<'a> Sync for DeployBuilder<'a>
impl<'a> Unpin for DeployBuilder<'a>
impl<'a> UnwindSafe for DeployBuilder<'a>
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
Source§impl<T> FmtForward for T
impl<T> FmtForward for T
Source§fn fmt_binary(self) -> FmtBinary<Self>where
Self: Binary,
fn fmt_binary(self) -> FmtBinary<Self>where
Self: Binary,
self to use its Binary implementation when Debug-formatted.Source§fn fmt_display(self) -> FmtDisplay<Self>where
Self: Display,
fn fmt_display(self) -> FmtDisplay<Self>where
Self: Display,
self to use its Display implementation when
Debug-formatted.Source§fn fmt_lower_exp(self) -> FmtLowerExp<Self>where
Self: LowerExp,
fn fmt_lower_exp(self) -> FmtLowerExp<Self>where
Self: LowerExp,
self to use its LowerExp implementation when
Debug-formatted.Source§fn fmt_lower_hex(self) -> FmtLowerHex<Self>where
Self: LowerHex,
fn fmt_lower_hex(self) -> FmtLowerHex<Self>where
Self: LowerHex,
self to use its LowerHex implementation when
Debug-formatted.Source§fn fmt_octal(self) -> FmtOctal<Self>where
Self: Octal,
fn fmt_octal(self) -> FmtOctal<Self>where
Self: Octal,
self to use its Octal implementation when Debug-formatted.Source§fn fmt_pointer(self) -> FmtPointer<Self>where
Self: Pointer,
fn fmt_pointer(self) -> FmtPointer<Self>where
Self: Pointer,
self to use its Pointer implementation when
Debug-formatted.Source§fn fmt_upper_exp(self) -> FmtUpperExp<Self>where
Self: UpperExp,
fn fmt_upper_exp(self) -> FmtUpperExp<Self>where
Self: UpperExp,
self to use its UpperExp implementation when
Debug-formatted.Source§fn fmt_upper_hex(self) -> FmtUpperHex<Self>where
Self: UpperHex,
fn fmt_upper_hex(self) -> FmtUpperHex<Self>where
Self: UpperHex,
self to use its UpperHex implementation when
Debug-formatted.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>
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>
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 moreSource§impl<T> PipeAsRef for T
impl<T> PipeAsRef for T
Source§impl<T> PipeBorrow for T
impl<T> PipeBorrow for T
Source§impl<T> PipeDeref for T
impl<T> PipeDeref for T
Source§impl<T> PipeRef for T
impl<T> PipeRef for T
Source§impl<T> Tap for T
impl<T> Tap for T
Source§fn tap<F, R>(self, func: F) -> Selfwhere
F: FnOnce(&Self) -> R,
fn tap<F, R>(self, func: F) -> Selfwhere
F: FnOnce(&Self) -> R,
Source§fn tap_dbg<F, R>(self, func: F) -> Selfwhere
F: FnOnce(&Self) -> R,
fn tap_dbg<F, R>(self, func: F) -> Selfwhere
F: FnOnce(&Self) -> R,
tap in debug builds, and does nothing in release builds.Source§fn tap_mut<F, R>(self, func: F) -> Selfwhere
F: FnOnce(&mut Self) -> R,
fn tap_mut<F, R>(self, func: F) -> Selfwhere
F: FnOnce(&mut Self) -> R,
Source§fn tap_mut_dbg<F, R>(self, func: F) -> Selfwhere
F: FnOnce(&mut Self) -> R,
fn tap_mut_dbg<F, R>(self, func: F) -> Selfwhere
F: FnOnce(&mut Self) -> R,
tap_mut in debug builds, and does nothing in release builds.Source§impl<T, U> TapAsRef<U> for Twhere
U: ?Sized,
impl<T, U> TapAsRef<U> for Twhere
U: ?Sized,
Source§fn tap_ref<F, R>(self, func: F) -> Self
fn tap_ref<F, R>(self, func: F) -> Self
Source§fn tap_ref_dbg<F, R>(self, func: F) -> Self
fn tap_ref_dbg<F, R>(self, func: F) -> Self
tap_ref in debug builds, and does nothing in release builds.Source§fn tap_ref_mut<F, R>(self, func: F) -> Self
fn tap_ref_mut<F, R>(self, func: F) -> Self
Source§impl<T, U> TapBorrow<U> for Twhere
U: ?Sized,
impl<T, U> TapBorrow<U> for Twhere
U: ?Sized,
Source§fn tap_borrow<F, R>(self, func: F) -> Self
fn tap_borrow<F, R>(self, func: F) -> Self
Source§fn tap_borrow_dbg<F, R>(self, func: F) -> Self
fn tap_borrow_dbg<F, R>(self, func: F) -> Self
tap_borrow in debug builds, and does nothing in release builds.Source§fn tap_borrow_mut<F, R>(self, func: F) -> Self
fn tap_borrow_mut<F, R>(self, func: F) -> Self
Source§impl<T> TapDeref for T
impl<T> TapDeref for T
Source§fn tap_deref_dbg<F, R>(self, func: F) -> Self
fn tap_deref_dbg<F, R>(self, func: F) -> Self
tap_deref in debug builds, and does nothing in release builds.Source§fn tap_deref_mut<F, R>(self, func: F) -> Self
fn tap_deref_mut<F, R>(self, func: F) -> Self
self for modification.