implement rough getSubset call and type

This commit is contained in:
mycognosist 2021-12-27 19:58:15 +02:00 committed by adria0.eth
parent a02db1606a
commit 469615f110
2 changed files with 21 additions and 1 deletions

View File

@ -4,6 +4,7 @@ use std::collections::HashMap;
pub type SsbHash = String;
pub type SsbId = String;
pub type SsbMsgType = String;
#[derive(Debug, Serialize, Deserialize)]
pub struct Mention {
@ -142,3 +143,22 @@ pub enum TypedMessage {
#[serde(rename = "vote")]
Vote { vote: Vote },
}
//op args name args type
//and args [op, ...]
//or args [op, ...]
//type string string
//author feed string
#[derive(Debug, Serialize, Deserialize)]
#[serde(untagged)]
pub enum SubsetQuery {
// {"op":"type","string":"foo"}
Type { op: String, string: SsbMsgType },
//#[serde(rename = "author")]
Author { op: String, feed: SsbId },
//#[serde(rename = "and")]
//And { args: Vec<SubsetQuery> },
//#[serde(rename = "or")]
//Or { args: Vec<SubsetQuery> },
}

View File

@ -1,5 +1,5 @@
use crate::{
api::dto::content::TypedMessage,
api::dto::content::{SubsetQuery, TypedMessage},
feed::Message,
rpc::{Body, BodyType, RequestNo, RpcType, RpcWriter},
};