Scalable and distributed custom feed generator, ott - on that topic
at main 41 lines 772 B view raw
1use serde::{Deserialize, Serialize}; 2 3#[derive(Debug, Deserialize, Clone)] 4pub struct RawPost { 5 pub did: String, 6 pub uri: String, 7 pub commit: Commit, 8} 9 10#[derive(Debug, Deserialize, Clone)] 11#[serde(tag = "operation", rename_all = "lowercase")] 12pub enum Commit { 13 Create { record: Record }, 14 Delete, 15 Update, 16} 17 18#[derive(Debug, Deserialize, Clone)] 19pub struct Record { 20 pub text: String, 21} 22 23#[derive(Debug, Serialize, Deserialize, Clone, Default)] 24pub struct Post { 25 pub did: String, 26 pub uri: String, 27 pub text: String, 28 pub count: u32, 29} 30 31#[derive(Debug, Deserialize, Clone)] 32pub struct Like { 33 pub did: String, 34 pub uri: String, 35} 36 37#[derive(Debug, Clone)] 38pub struct Embedding { 39 pub uri: String, 40 pub vector: Vec<f32>, 41}