Struct luk_chain::Event [−][src]
pub struct Event<T> {
pub made_by: u128,
pub data: T,
pub nonce: u128,
pub signature: Option<Vec<u8>>,
pub created_at: Duration,
}Expand description
Events that are stored on [BlockChain]
When something needs to be stored on the [BlockChain], an
Event is created, and the data to be stored on the chain
is contained within it.
Fields
made_by: u128ID of node which created Event
data: TCentral information of Event
nonce: u128Random value to ensure uniqueness
signature: Option<Vec<u8>>Mechanism to provide validity of Event
created_at: DurationTime Event was created 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 Event<T> where
T: RefUnwindSafe,
impl<T> UnwindSafe for Event<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