diff options
Diffstat (limited to 'src/repo/channel.rs')
| -rw-r--r-- | src/repo/channel.rs | 39 |
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) - } -} |
