pub struct Transaction(/* private fields */);
Implementations§
Source§impl Transaction
impl Transaction
Sourcepub fn calc_tx_hash(&self) -> Byte32
pub fn calc_tx_hash(&self) -> Byte32
Calls TransactionReader.calc_tx_hash()
for self.as_reader()
.
Source§impl Transaction
impl Transaction
Sourcepub fn calc_witness_hash(&self) -> Byte32
pub fn calc_witness_hash(&self) -> Byte32
Source§impl Transaction
impl Transaction
Sourcepub fn is_cellbase(&self) -> bool
pub fn is_cellbase(&self) -> bool
Checks whether self is a cellbase.
Sourcepub fn proposal_short_id(&self) -> ProposalShortId
pub fn proposal_short_id(&self) -> ProposalShortId
Generates a proposal short id after calculating the transaction hash.
Source§impl Transaction
impl Transaction
Sourcepub fn serialized_size_in_block(&self) -> usize
pub fn serialized_size_in_block(&self) -> usize
Source§impl Transaction
impl Transaction
pub const FIELD_COUNT: usize = 2usize
pub fn total_size(&self) -> usize
pub fn field_count(&self) -> usize
pub fn count_extra_fields(&self) -> usize
pub fn has_extra_fields(&self) -> bool
pub fn raw(&self) -> RawTransaction
pub fn witnesses(&self) -> BytesVec
pub fn as_reader<'r>(&'r self) -> TransactionReader<'r>
Trait Implementations§
Source§impl AsTransactionBuilder for Transaction
impl AsTransactionBuilder for Transaction
Source§fn as_advanced_builder(&self) -> TransactionBuilder
fn as_advanced_builder(&self) -> TransactionBuilder
Creates an advanced builder base on current data.
Source§impl Clone for Transaction
impl Clone for Transaction
Source§fn clone(&self) -> Transaction
fn clone(&self) -> Transaction
Returns a copy of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreSource§impl Debug for Transaction
impl Debug for Transaction
Source§impl Default for Transaction
impl Default for Transaction
Source§fn default() -> Transaction
fn default() -> Transaction
Returns the “default value” for a type. Read more
Source§impl Display for Transaction
impl Display for Transaction
Source§impl Entity for Transaction
impl Entity for Transaction
const NAME: &'static str = "Transaction"
type Builder = TransactionBuilder
fn new_unchecked(data: Bytes) -> Transaction
fn as_bytes(&self) -> Bytes
fn as_slice(&self) -> &[u8] ⓘ
fn from_slice(slice: &[u8]) -> Result<Transaction, VerificationError>
fn from_compatible_slice(slice: &[u8]) -> Result<Transaction, VerificationError>
fn new_builder() -> <Transaction as Entity>::Builder
fn as_builder(self) -> <Transaction as Entity>::Builder
Source§impl IntoTransactionView for Transaction
impl IntoTransactionView for Transaction
Source§fn into_view(self) -> TransactionView
fn into_view(self) -> TransactionView
Converts the implementing type into a
TransactionView
.Auto Trait Implementations§
impl !Freeze for Transaction
impl RefUnwindSafe for Transaction
impl Send for Transaction
impl Sync for Transaction
impl Unpin for Transaction
impl UnwindSafe for Transaction
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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit
)Source§impl<T> PackVec<TransactionVec, Transaction> for Twhere
T: IntoIterator<Item = Transaction>,
impl<T> PackVec<TransactionVec, Transaction> for Twhere
T: IntoIterator<Item = Transaction>,
Source§fn pack(self) -> TransactionVec
fn pack(self) -> TransactionVec
Packs a vector of binary data into one binary data.