Struct era_test_node::node::BlockContext
source · pub struct BlockContext {
pub batch: u32,
pub miniblock: u64,
pub timestamp: u64,
}
Expand description
Keeps track of a block’s batch number, miniblock number and timestamp. Useful for keeping track of the current context when creating multiple blocks.
Fields§
§batch: u32
§miniblock: u64
§timestamp: u64
Implementations§
source§impl BlockContext
impl BlockContext
sourcepub fn from_current(batch: u32, miniblock: u64, timestamp: u64) -> Self
pub fn from_current(batch: u32, miniblock: u64, timestamp: u64) -> Self
Create the current instance that represents the latest block.
sourcepub fn new_batch(&self) -> Self
pub fn new_batch(&self) -> Self
Create the next batch instance that has all parameters incremented by 1
.
sourcepub fn new_block(&self) -> BlockContext
pub fn new_block(&self) -> BlockContext
Create the next batch instance that uses the same batch number, and has all other parameters incremented by 1
.
Trait Implementations§
source§impl Clone for BlockContext
impl Clone for BlockContext
source§fn clone(&self) -> BlockContext
fn clone(&self) -> BlockContext
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 BlockContext
impl Debug for BlockContext
source§impl Default for BlockContext
impl Default for BlockContext
source§fn default() -> BlockContext
fn default() -> BlockContext
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl RefUnwindSafe for BlockContext
impl Send for BlockContext
impl Sync for BlockContext
impl Unpin for BlockContext
impl UnwindSafe for BlockContext
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
§impl<T> FutureExt for T
impl<T> FutureExt for T
§fn with_context(self, otel_cx: Context) -> WithContext<Self>
fn with_context(self, otel_cx: Context) -> WithContext<Self>
§fn with_current_context(self) -> WithContext<Self>
fn with_current_context(self) -> WithContext<Self>
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
source§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
Wrap the input message
T
in a tonic::Request