elasticsearch_dsl/search/queries/params/
shape_query.rs1use serde::Serialize;
2
3#[derive(Debug, Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Serialize)]
5#[serde(rename_all = "SCREAMING_SNAKE_CASE")]
6pub enum SpatialRelation {
7 Intersects,
9
10 Disjoint,
13
14 Within,
16
17 Contains,
19}
20
21impl Default for SpatialRelation {
22 fn default() -> Self {
23 Self::Intersects
24 }
25}
26
27#[cfg(test)]
28mod tests {
29 use super::*;
30 use crate::util::*;
31
32 #[test]
33 fn serialization() {
34 assert_serialize(
35 [
36 SpatialRelation::Intersects,
37 SpatialRelation::Disjoint,
38 SpatialRelation::Within,
39 SpatialRelation::Contains,
40 ],
41 json!(["INTERSECTS", "DISJOINT", "WITHIN", "CONTAINS"]),
42 );
43 }
44}