Enum cernan::metric::Event [−][src]
pub enum Event {
Telemetry(Telemetry),
Log(LogLine),
TimerFlush(u64),
Shutdown,
Raw {
order_by: u64,
encoding: Encoding,
bytes: Vec<u8>,
},
}Event: the central cernan datastructure
Event is the heart of cernan, the enumeration that cernan works on in all cases. The enumeration fields drive sink / source / filter operations depending on their implementation.
Variants
Telemetry(Telemetry)A wrapper for metric::Telemetry. See its documentation for more
detail.
Log(LogLine)A wrapper for metric::LogLine. See its documentation for more
detail.
TimerFlush(u64)A flush pulse signal. The TimerFlush keeps a counter of the total
flushes made in this cernan's run. See source::Flush for the origin of
these pulses in cernan operation.
ShutdownShutdown event which marks the location in the queue after which no more events will appear. It is expected that after receiving this marker the given source will exit cleanly.
RawRaw, encoded bytes.
Fields of Raw
order_by: u64 | Ordering value used by some sinks accepting Raw events. |
encoding: Encoding | Encoding for the included bytes. |
bytes: Vec<u8> | Encoded payload. |
Methods
impl Event[src]
impl Eventpub fn is_timer_flush(&self) -> bool[src]
pub fn is_timer_flush(&self) -> boolDetermine if an event is a TimerFlush.
pub fn timestamp(&self) -> Option<i64>[src]
pub fn timestamp(&self) -> Option<i64>Retrieve the timestamp from an Event if such exists. TimerFlush has
no sensible timestamp -- being itself a mechanism of time, not inside
time -- and these Events will always return None.
impl Event[src]
impl Eventpub fn new_telemetry(metric: Telemetry) -> Event[src]
pub fn new_telemetry(metric: Telemetry) -> EventCreate a new Event::Telemetry from an existing metric::Telemetry.
pub fn new_log(log: LogLine) -> Event[src]
pub fn new_log(log: LogLine) -> EventCreate a new Event::Log from an existing metric::LogLine.
Trait Implementations
impl PartialEq for Event[src]
impl PartialEq for Eventfn eq(&self, other: &Event) -> bool[src]
fn eq(&self, other: &Event) -> boolThis method tests for self and other values to be equal, and is used by ==. Read more
fn ne(&self, other: &Event) -> bool[src]
fn ne(&self, other: &Event) -> boolThis method tests for !=.
impl Debug for Event[src]
impl Debug for Eventfn fmt(&self, f: &mut Formatter) -> Result[src]
fn fmt(&self, f: &mut Formatter) -> ResultFormats the value using the given formatter. Read more
impl Clone for Event[src]
impl Clone for Event