1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
#[derive(Clone, Debug)]
pub enum QueryKind {
Tag(String),
Class(String),
Attr { name: String, value: String },
}
#[derive(Debug)]
pub enum DataLocation {
Text,
Attr(String),
}
#[derive(Debug)]
pub struct Query {
pub kind: QueryKind,
pub ignore: Option<Vec<QueryKind>>,
}
#[derive(Debug)]
pub struct QueryData {
pub query: Vec<Query>,
pub data_location: DataLocation,
}
#[derive(Debug)]
pub struct TitleQuery(pub QueryData);
#[derive(Debug)]
pub struct TextQuery {
pub prepend: Option<String>,
pub inner: QueryData,
}
#[derive(Clone, Copy, Debug)]
pub enum IdQueryKind {
String,
Date,
}
#[derive(Debug)]
pub struct IdQuery {
pub kind: IdQueryKind,
pub inner: QueryData,
}
#[derive(Debug)]
pub struct UrlQuery {
pub prepend: Option<String>,
pub inner: QueryData,
}
#[derive(Debug)]
pub struct ImageQuery {
pub optional: bool,
pub url: UrlQuery,
}