partway through fixes, macro system needs resdesign
Some checks failed
Rust / build (push) Has been cancelled
Some checks failed
Rust / build (push) Has been cancelled
This commit is contained in:
@@ -376,3 +376,13 @@ impl Encode for chrono::TimeDelta {
|
||||
self.subsec_nanos().encode(write).await
|
||||
}
|
||||
}
|
||||
impl Decode for chrono::DateTime<chrono::Utc> {
|
||||
async fn decode<R: AsyncRead + ?Sized>(read: Pin<&mut R>) -> io::Result<Self> {
|
||||
Ok(Self::from_timestamp_micros(i64::decode(read).await?).unwrap())
|
||||
}
|
||||
}
|
||||
impl Encode for chrono::DateTime<chrono::Utc> {
|
||||
async fn encode<W: AsyncWrite + ?Sized>(&self, write: Pin<&mut W>) -> io::Result<()> {
|
||||
self.timestamp_micros().encode(write).await
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user