implement rough getSubset call and type
This commit is contained in:
parent
a02db1606a
commit
469615f110
|
@ -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> },
|
||||
}
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
use crate::{
|
||||
api::dto::content::TypedMessage,
|
||||
api::dto::content::{SubsetQuery, TypedMessage},
|
||||
feed::Message,
|
||||
rpc::{Body, BodyType, RequestNo, RpcType, RpcWriter},
|
||||
};
|
||||
|
|
Loading…
Reference in New Issue