Deliver channel status events
This commit is contained in:
@@ -6,9 +6,18 @@ use serde::Deserialize;
|
||||
use serde::Serialize;
|
||||
use serde::Serializer;
|
||||
|
||||
#[derive(Clone, Debug, Deserialize)]
|
||||
#[derive(Debug, Clone, PartialEq, Deserialize)]
|
||||
pub struct IsoDateTime(DateTime<Utc>);
|
||||
|
||||
impl IsoDateTime {
|
||||
pub fn from_unix_millis(ms: u64) -> Self {
|
||||
let datetime = chrono::NaiveDateTime::from_timestamp_millis(ms as i64)
|
||||
.unwrap()
|
||||
.and_utc();
|
||||
Self(datetime)
|
||||
}
|
||||
}
|
||||
|
||||
impl Serialize for IsoDateTime {
|
||||
fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
|
||||
where
|
||||
|
||||
@@ -39,6 +39,10 @@ pub trait Appendable<STY>: Empty + WithLen {
|
||||
fn push(&mut self, ts: u64, pulse: u64, value: STY);
|
||||
}
|
||||
|
||||
pub trait Extendable: Empty + WithLen {
|
||||
fn extend_from(&mut self, src: &mut Self);
|
||||
}
|
||||
|
||||
pub trait TypeName {
|
||||
fn type_name(&self) -> String;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user