pub struct Transaction<'a> {
pub version: i32,
pub is_segwit: bool,
pub inputs: &'a [TxInput<'a>],
pub outputs: &'a [TxOutput<'a>],
pub witnesses: &'a [Witness<'a>],
pub locktime: u32,
pub raw: &'a [u8],
}Expand description
A fully parsed Bitcoin transaction.
Note: This struct requires the caller to provide backing storage for the
inputs, outputs, and witnesses slices (e.g. stack arrays or arena
buffers). For allocation-free use, prefer TransactionParser with its
closure API.
All fields borrow from the original parse buffer — zero allocations in the parser itself.
Fields§
§version: i32Serialised version (1 or 2).
is_segwit: boolWhether this transaction uses the SegWit format (BIP 141).
inputs: &'a [TxInput<'a>]Transaction inputs.
outputs: &'a [TxOutput<'a>]Transaction outputs.
witnesses: &'a [Witness<'a>]Witness data, one per input (empty slice for non-segwit).
locktime: u32Lock time.
raw: &'a [u8]Zero-copy reference to the raw bytes of this transaction.
Trait Implementations§
Auto Trait Implementations§
impl<'a> Freeze for Transaction<'a>
impl<'a> RefUnwindSafe for Transaction<'a>
impl<'a> Send for Transaction<'a>
impl<'a> Sync for Transaction<'a>
impl<'a> Unpin for Transaction<'a>
impl<'a> UnsafeUnpin for Transaction<'a>
impl<'a> UnwindSafe for Transaction<'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
Mutably borrows from an owned value. Read more