summaryrefslogtreecommitdiff
path: root/src/header.rs
diff options
context:
space:
mode:
authorOwen Jacobson <owen@grimoire.ca>2024-09-20 23:27:59 -0400
committerOwen Jacobson <owen@grimoire.ca>2024-09-20 23:27:59 -0400
commita4dcc4b5c53966f3c4366e414a3e39d094f21404 (patch)
treecc6b3ab3876bb05a81d03569aa6d9a42cdc3c6d1 /src/header.rs
parent0a05491930fb34ce7c93c33ea0b7599360483fc7 (diff)
Push the handling of the `Last-Event-Id` _format_ inside of `channels::app`.
This is intended to make it a bit more opaque to callers, and to free me up to experiment with the event ID format. It also makes event IDs tractable for testing.
Diffstat (limited to 'src/header.rs')
-rw-r--r--src/header.rs15
1 files changed, 15 insertions, 0 deletions
diff --git a/src/header.rs b/src/header.rs
index 904e29d..61cc561 100644
--- a/src/header.rs
+++ b/src/header.rs
@@ -56,3 +56,18 @@ where
Ok(requested_at)
}
}
+
+impl From<String> for LastEventId {
+ fn from(header: String) -> Self {
+ Self(header)
+ }
+}
+
+impl std::ops::Deref for LastEventId {
+ type Target = str;
+
+ fn deref(&self) -> &Self::Target {
+ let Self(header) = self;
+ header
+ }
+}