use sea_orm::entity::prelude::*; #[derive(Clone, Debug, PartialEq, DeriveEntityModel, Eq)] #[sea_orm(table_name = "users")] pub struct Model { #[sea_orm(primary_key)] /// must be user@instance.org, even if local! TODO bad design... pub id: String, pub name: Option, } #[derive(Copy, Clone, Debug, EnumIter, DeriveRelation)] pub enum Relation {} impl ActiveModelBehavior for ActiveModel {} impl crate::activitystream::Object for Model { fn id(&self) -> Option<&str> { Some(&self.id) } fn name (&self) -> Option<&str> { self.name.as_deref() } }