Struct luk_chain::Block [−][src]
pub struct Block<T> {
pub events: Vec<Event<T>>,
pub prev_hash: Option<String>,
pub hash: Option<String>,
pub nonce: u128,
pub created_at: Duration,
}Expand description
Encapsulation of groups of events mined and stored on BlockChain
Fields
events: Vec<Event<T>>Events contained within Block
prev_hash: Option<String>Hash of preceding Block in BlockChain
hash: Option<String>Hash of Block
nonce: u128Random value for each instance
created_at: DurationTime Block was created at since Epoch
Implementations
Trait Implementations
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error> where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error> where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations
impl<T> RefUnwindSafe for Block<T> where
T: RefUnwindSafe,
impl<T> UnwindSafe for Block<T> where
T: UnwindSafe,
Blanket Implementations
Mutably borrows from an owned value. Read more
Instruments this type with the provided Span, returning an
Instrumented wrapper. Read more
fn from_stream<'life0, 'life1, 'async_trait, R: AsyncReadExt + Send + Unpin>(
stream: &'life0 mut R,
buffer: &'life1 mut [u8]
) -> Pin<Box<dyn Future<Output = Result<Self>> + Send + 'async_trait>> where
R: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Self: Send + 'async_trait,
fn from_stream<'life0, 'life1, 'async_trait, R: AsyncReadExt + Send + Unpin>(
stream: &'life0 mut R,
buffer: &'life1 mut [u8]
) -> Pin<Box<dyn Future<Output = Result<Self>> + Send + 'async_trait>> where
R: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Self: Send + 'async_trait,
Reads a [Message] from a raw stream of bytes, dealing with length prefixing.
type Output = T
type Output = T
Should always be Self