surrealdb_core/sql/
dir.rs1use 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 In,
11 Out,
12 Both,
13}
14
15impl Default for Dir {
16 fn default() -> Self {
17 Self::Both
18 }
19}
20
21impl fmt::Display for Dir {
22 fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
23 f.write_str(match self {
24 Self::In => "<-",
25 Self::Out => "->",
26 Self::Both => "<->",
27 })
28 }
29}