diff options
author | Harald Eilertsen <haraldei@anduin.net> | 2024-01-13 13:00:25 +0100 |
---|---|---|
committer | Harald Eilertsen <haraldei@anduin.net> | 2024-01-13 13:00:25 +0100 |
commit | d9fa0a00889e40baf5289a65e17d47727b7c506e (patch) | |
tree | 7701c959a0351f381e06fa287f5f1b525f889485 /src/stream/streamitem.rs | |
parent | a43422b4d4ed4d89e1ca8fc316dd372e5dd9cb34 (diff) | |
download | rust-zotapi-d9fa0a00889e40baf5289a65e17d47727b7c506e.tar.gz rust-zotapi-d9fa0a00889e40baf5289a65e17d47727b7c506e.tar.bz2 rust-zotapi-d9fa0a00889e40baf5289a65e17d47727b7c506e.zip |
Add stream::DateTime struct
As the date and time returned in the json data from the zot stream api's
neither contains any timezone information, nor follow the RFC3339 format
expected by Chrono, we need to make our own date time type, and handle
deserialization ourselves.
Diffstat (limited to 'src/stream/streamitem.rs')
-rw-r--r-- | src/stream/streamitem.rs | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/src/stream/streamitem.rs b/src/stream/streamitem.rs index 1934dfe..514cae3 100644 --- a/src/stream/streamitem.rs +++ b/src/stream/streamitem.rs @@ -7,6 +7,7 @@ * SPDX-License-Identifier: AGPL-3.0-or-later */ +use super::datetime::DateTime; use super::verb::Verb; use serde::Deserialize; @@ -32,6 +33,16 @@ pub struct StreamItem { pub item_type: StreamItemType, pub encoding: StreamItemEncoding, + /* + * Date and time fields for when the item was + * created, last edited or commented, as well as + * when/if it expires. + */ + pub created: DateTime, + pub edited: DateTime, + pub expires: DateTime, + pub commented: DateTime, + pub verb: Verb, pub title: String, |