From a4dcc4b5c53966f3c4366e414a3e39d094f21404 Mon Sep 17 00:00:00 2001 From: Owen Jacobson Date: Fri, 20 Sep 2024 23:27:59 -0400 Subject: 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. --- src/header.rs | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'src/header.rs') 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 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 + } +} -- cgit v1.2.3