Fix(dumps): Explicitly define serde for time

This commit is contained in:
ManyTheFish 2022-03-01 19:02:32 +01:00
parent 5515aa5045
commit c2b58720d1
5 changed files with 29 additions and 8 deletions

View file

@ -54,9 +54,9 @@ pub struct ProcessedUpdateResult {
#[serde(rename = "type")]
pub update_type: UpdateType,
pub duration: f64, // in seconds
#[serde(serialize_with = "time::serde::rfc3339::serialize")]
#[serde(with = "time::serde::rfc3339")]
pub enqueued_at: OffsetDateTime,
#[serde(serialize_with = "time::serde::rfc3339::serialize")]
#[serde(with = "time::serde::rfc3339")]
pub processed_at: OffsetDateTime,
}
@ -68,9 +68,9 @@ pub struct FailedUpdateResult {
pub update_type: UpdateType,
pub error: ResponseError,
pub duration: f64, // in seconds
#[serde(serialize_with = "time::serde::rfc3339::serialize")]
#[serde(with = "time::serde::rfc3339")]
pub enqueued_at: OffsetDateTime,
#[serde(serialize_with = "time::serde::rfc3339::serialize")]
#[serde(with = "time::serde::rfc3339")]
pub processed_at: OffsetDateTime,
}
@ -80,11 +80,11 @@ pub struct EnqueuedUpdateResult {
pub update_id: u64,
#[serde(rename = "type")]
pub update_type: UpdateType,
#[serde(serialize_with = "time::serde::rfc3339::serialize")]
#[serde(with = "time::serde::rfc3339")]
pub enqueued_at: OffsetDateTime,
#[serde(
skip_serializing_if = "Option::is_none",
serialize_with = "time::serde::rfc3339::option::serialize"
with = "time::serde::rfc3339::option"
)]
pub started_processing_at: Option<OffsetDateTime>,
}