summa_core/proto_traits/
order.rs

1use summa_proto::proto;
2
3use crate::proto_traits::Wrapper;
4
5impl From<Wrapper<proto::Order>> for tantivy::Order {
6    fn from(order: Wrapper<proto::Order>) -> Self {
7        match order.into_inner() {
8            proto::Order::Asc => tantivy::Order::Asc,
9            proto::Order::Desc => tantivy::Order::Desc,
10        }
11    }
12}
13
14impl From<Wrapper<proto::Order>> for tantivy::aggregation::bucket::Order {
15    fn from(order: Wrapper<proto::Order>) -> Self {
16        match order.into_inner() {
17            proto::Order::Asc => tantivy::aggregation::bucket::Order::Asc,
18            proto::Order::Desc => tantivy::aggregation::bucket::Order::Desc,
19        }
20    }
21}