]> Untitled Git - lemmy.git/blobdiff - lemmy_db/src/lib.rs
Merge branch 'main' into move_views_to_diesel
[lemmy.git] / lemmy_db / src / lib.rs
index b5348a6ca29c9d3aaed30146fc45f4cac4eee3ff..0cf1cd61c6f3dfadd3847287b8f30446f6cb4771 100644 (file)
@@ -123,6 +123,15 @@ pub trait Reportable<T> {
     Self: Sized;
 }
 
+pub trait ApubObject<T> {
+  fn read_from_apub_id(conn: &PgConnection, object_id: &str) -> Result<Self, Error>
+  where
+    Self: Sized;
+  fn upsert(conn: &PgConnection, user_form: &T) -> Result<Self, Error>
+  where
+    Self: Sized;
+}
+
 pub trait MaybeOptional<T> {
   fn get_optional(self) -> Option<T>;
 }