pub struct SpanBatchPayload {
pub block_count: u64,
pub origin_bits: SpanBatchBits,
pub block_tx_counts: Vec<u64>,
pub txs: SpanBatchTransactions,
}
Available on crate feature
protocol
only.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<SpanBatchPayload, SpanBatchError>
pub fn decode_payload(r: &mut &[u8]) -> Result<SpanBatchPayload, SpanBatchError>
Decodes a SpanBatchPayload from a reader.
Sourcepub fn encode_payload(&self, w: &mut dyn BufMut) -> Result<(), SpanBatchError>
pub fn encode_payload(&self, w: &mut dyn BufMut) -> 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 dyn BufMut,
) -> Result<(), SpanBatchError>
pub fn encode_origin_bits( &self, w: &mut dyn BufMut, ) -> Result<(), SpanBatchError>
Encode the origin bits into a writer.
Sourcepub fn encode_block_count(&self, w: &mut dyn BufMut)
pub fn encode_block_count(&self, w: &mut dyn BufMut)
Encode the block count into a writer.
Sourcepub fn encode_block_tx_counts(&self, w: &mut dyn BufMut)
pub fn encode_block_tx_counts(&self, w: &mut dyn BufMut)
Encode the block transaction counts into a writer.
Sourcepub fn encode_txs(&self, w: &mut dyn BufMut) -> Result<(), SpanBatchError>
pub fn encode_txs(&self, w: &mut dyn BufMut) -> 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§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key
and return true
if they are equal.Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more