summaryrefslogtreecommitdiff
path: root/src/repo/channel.rs
diff options
context:
space:
mode:
authorOwen Jacobson <owen@grimoire.ca>2024-10-01 23:57:22 -0400
committerOwen Jacobson <owen@grimoire.ca>2024-10-01 23:57:22 -0400
commitf878f0b5eaa44e8ee8d67cbfd706926ff2119113 (patch)
treefd9534ebc884da59b4031e2bcf2eb2d9dac35a87 /src/repo/channel.rs
parentd171a258ad2119e39cb715f8800031fff16967dc (diff)
Organize IDs into top-level namespaces.
(This is part of a larger reorganization.)
Diffstat (limited to 'src/repo/channel.rs')
-rw-r--r--src/repo/channel.rs39
1 files changed, 1 insertions, 38 deletions
diff --git a/src/repo/channel.rs b/src/repo/channel.rs
index ad42710..9f1d930 100644
--- a/src/repo/channel.rs
+++ b/src/repo/channel.rs
@@ -1,12 +1,10 @@
-use std::fmt;
-
use sqlx::{sqlite::Sqlite, SqliteConnection, Transaction};
use super::sequence::Sequence;
use crate::{
+ channel::Id,
clock::DateTime,
events::types::{self},
- id::Id as BaseId,
};
pub trait Provider {
@@ -176,38 +174,3 @@ impl<'c> Channels<'c> {
Ok(channels)
}
}
-
-// Stable identifier for a [Channel]. Prefixed with `C`.
-#[derive(
- Clone,
- Debug,
- Eq,
- Hash,
- Ord,
- PartialEq,
- PartialOrd,
- sqlx::Type,
- serde::Deserialize,
- serde::Serialize,
-)]
-#[sqlx(transparent)]
-#[serde(transparent)]
-pub struct Id(BaseId);
-
-impl From<BaseId> for Id {
- fn from(id: BaseId) -> Self {
- Self(id)
- }
-}
-
-impl Id {
- pub fn generate() -> Self {
- BaseId::generate("C")
- }
-}
-
-impl fmt::Display for Id {
- fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
- self.0.fmt(f)
- }
-}