surrealdb_core/sql/
dir.rs

1use revision::revisioned;
2use serde::{Deserialize, Serialize};
3use std::fmt;
4
5#[revisioned(revision = 1)]
6#[derive(Clone, Debug, Eq, PartialEq, PartialOrd, Serialize, Deserialize, Hash)]
7#[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
8#[non_exhaustive]
9pub enum Dir {
10	/// `<-`
11	In,
12	/// `->`
13	Out,
14	/// `<->`
15	Both,
16}
17
18impl Default for Dir {
19	fn default() -> Self {
20		Self::Both
21	}
22}
23
24impl fmt::Display for Dir {
25	fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
26		f.write_str(match self {
27			Self::In => "<-",
28			Self::Out => "->",
29			Self::Both => "<->",
30		})
31	}
32}