pub struct SpanBatchPayload {
pub block_count: u64,
pub origin_bits: SpanBatchBits,
pub block_tx_counts: Vec<u64>,
pub txs: SpanBatchTransactions,
}
Expand description
Span Batch Payload
Fields§
§block_count: u64
Number of L2 block in the span
origin_bits: SpanBatchBits
Standard span-batch bitlist of blockCount bits. Each bit indicates if the L1 origin is changed at the L2 block.
block_tx_counts: Vec<u64>
List of transaction counts for each L2 block
txs: SpanBatchTransactions
Transactions encoded in SpanBatch specs
Implementations§
Source§impl SpanBatchPayload
impl SpanBatchPayload
Sourcepub fn decode_payload(r: &mut &[u8]) -> Result<Self, SpanBatchError>
pub fn decode_payload(r: &mut &[u8]) -> Result<Self, SpanBatchError>
Decodes a SpanBatchPayload from a reader.
Sourcepub fn encode_payload(&self, w: &mut Vec<u8>) -> Result<(), SpanBatchError>
pub fn encode_payload(&self, w: &mut Vec<u8>) -> Result<(), SpanBatchError>
Encodes a SpanBatchPayload into a writer.
Sourcepub fn decode_origin_bits(
&mut self,
r: &mut &[u8],
) -> Result<(), SpanBatchError>
pub fn decode_origin_bits( &mut self, r: &mut &[u8], ) -> Result<(), SpanBatchError>
Decodes the origin bits from a reader.
Sourcepub fn decode_block_count(
&mut self,
r: &mut &[u8],
) -> Result<(), SpanBatchError>
pub fn decode_block_count( &mut self, r: &mut &[u8], ) -> Result<(), SpanBatchError>
Decode a block count from a reader.
Sourcepub fn decode_block_tx_counts(
&mut self,
r: &mut &[u8],
) -> Result<(), SpanBatchError>
pub fn decode_block_tx_counts( &mut self, r: &mut &[u8], ) -> Result<(), SpanBatchError>
Decode block transaction counts from a reader.
Sourcepub fn decode_txs(&mut self, r: &mut &[u8]) -> Result<(), SpanBatchError>
pub fn decode_txs(&mut self, r: &mut &[u8]) -> Result<(), SpanBatchError>
Decode transactions from a reader.
Sourcepub fn encode_origin_bits(&self, w: &mut Vec<u8>) -> Result<(), SpanBatchError>
pub fn encode_origin_bits(&self, w: &mut Vec<u8>) -> Result<(), SpanBatchError>
Encode the origin bits into a writer.
Sourcepub fn encode_block_count(&self, w: &mut Vec<u8>)
pub fn encode_block_count(&self, w: &mut Vec<u8>)
Encode the block count into a writer.
Sourcepub fn encode_block_tx_counts(&self, w: &mut Vec<u8>)
pub fn encode_block_tx_counts(&self, w: &mut Vec<u8>)
Encode the block transaction counts into a writer.
Sourcepub fn encode_txs(&self, w: &mut Vec<u8>) -> Result<(), SpanBatchError>
pub fn encode_txs(&self, w: &mut Vec<u8>) -> Result<(), SpanBatchError>
Encode the transactions into a writer.
Trait Implementations§
Source§impl Clone for SpanBatchPayload
impl Clone for SpanBatchPayload
Source§fn clone(&self) -> SpanBatchPayload
fn clone(&self) -> SpanBatchPayload
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 SpanBatchPayload
impl Debug for SpanBatchPayload
Source§impl Default for SpanBatchPayload
impl Default for SpanBatchPayload
Source§fn default() -> SpanBatchPayload
fn default() -> SpanBatchPayload
Returns the “default value” for a type. Read more
Source§impl PartialEq for SpanBatchPayload
impl PartialEq for SpanBatchPayload
impl Eq for SpanBatchPayload
impl StructuralPartialEq for SpanBatchPayload
Auto Trait Implementations§
impl Freeze for SpanBatchPayload
impl RefUnwindSafe for SpanBatchPayload
impl Send for SpanBatchPayload
impl Sync for SpanBatchPayload
impl Unpin for SpanBatchPayload
impl UnwindSafe for SpanBatchPayload
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
)