pub struct InternalEvent {
pub raw: Bytes,
pub insertion_ts: u64,
pub shard_id: u16,
}Expand description
Internal event representation with metadata assigned at ingestion.
This is the canonical form of an event within the event bus.
The insertion_ts provides deterministic ordering within a shard.
Uses Bytes for zero-copy, reference-counted storage.
Fields§
§raw: BytesPre-serialized JSON payload (reference-counted, zero-copy clone).
insertion_ts: u64Monotonically increasing insertion timestamp (nanoseconds). Strictly ordered within a shard, not globally.
shard_id: u16Shard this event was assigned to.
Implementations§
Source§impl InternalEvent
impl InternalEvent
Sourcepub fn new(raw: Bytes, insertion_ts: u64, shard_id: u16) -> Self
pub fn new(raw: Bytes, insertion_ts: u64, shard_id: u16) -> Self
Create a new internal event from raw bytes.
Sourcepub fn from_value(value: JsonValue, insertion_ts: u64, shard_id: u16) -> Self
pub fn from_value(value: JsonValue, insertion_ts: u64, shard_id: u16) -> Self
Create from a JSON value (serializes once).
See RawEvent::from_value for the rationale on
unwrap_or_default() instead of expect().
Trait Implementations§
Source§impl Clone for InternalEvent
impl Clone for InternalEvent
Source§fn clone(&self) -> InternalEvent
fn clone(&self) -> InternalEvent
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl !Freeze for InternalEvent
impl RefUnwindSafe for InternalEvent
impl Send for InternalEvent
impl Sync for InternalEvent
impl Unpin for InternalEvent
impl UnsafeUnpin for InternalEvent
impl UnwindSafe for InternalEvent
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