Struct ckb_types::packed::Transaction
source · 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
type Builder = TransactionBuilder
const NAME: &'static str = "Transaction"
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 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> 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.