pub struct Transaction {
pub nonce: u64,
pub data: Vec<u8>,
}Expand description
A struct representing a transaction with a nonce and associated data.
The Transaction structure is used to manage operations with specific data and unique nonces.
Fields§
§nonce: u64§data: Vec<u8>Implementations§
Source§impl Transaction
impl Transaction
Sourcepub fn new(data: Vec<u8>, nonce: u64) -> Self
pub fn new(data: Vec<u8>, nonce: u64) -> Self
Creates a new Transaction with the given data and nonce.
The data size is limited to 1024 bytes to ensure the transaction payload is reasonable.
§Arguments
data- A vector of bytes representing the transaction’s data.nonce- A unique number (nonce) to differentiate this transaction from others.
§Panics
Panics if the data length exceeds 1024 bytes.
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§
§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more