pub enum TransactionResult {
Hash(H256),
Receipt(TransactionReceipt),
}Expand description
Represents the result of a sent transaction that can either be a transaction
hash, in the case the transaction was not confirmed, or a full transaction
receipt if the TransactionBuilder was configured to wait for confirmation
blocks.
Note that the result will always be a TransactionResult::Hash if
Confirm::Skip was used and TransactionResult::Receipt if
Confirm::Blocks was used.
Variants§
Hash(H256)
A transaction hash, this variant happens if and only if confirmation was skipped.
Receipt(TransactionReceipt)
A transaction receipt, this variant happens if and only if the transaction was configured to wait for confirmations.
Implementations§
source§impl TransactionResult
impl TransactionResult
sourcepub fn is_hash(&self) -> bool
pub fn is_hash(&self) -> bool
Returns true if the TransactionResult is a Hash variant, i.e. it is
only a hash and does not contain the transaction receipt.
sourcepub fn is_receipt(&self) -> bool
pub fn is_receipt(&self) -> bool
Returns true if the TransactionResult is a Receipt variant, i.e. the
transaction was confirmed and the full transaction receipt is available.
sourcepub fn as_receipt(&self) -> Option<&TransactionReceipt>
pub fn as_receipt(&self) -> Option<&TransactionReceipt>
Extract a TransactionReceipt from the result. This will return None
if the result is only a hash and the transaction receipt is not
available.
Trait Implementations§
source§impl Clone for TransactionResult
impl Clone for TransactionResult
source§fn clone(&self) -> TransactionResult
fn clone(&self) -> TransactionResult
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more