Skip to main content

surrealdb_expr/expr/convert/
dir.rs

1//! `sql` -> `expr` conversions for [`crate::sql::dir`].
2//!
3//! Lives in core rather than beside the AST: `surrealdb-sql` sits below
4//! core, so it cannot name `expr` types.
5
6use crate::sql::dir::*;
7
8impl From<Dir> for crate::expr::Dir {
9	fn from(v: Dir) -> Self {
10		match v {
11			Dir::In => Self::In,
12			Dir::Out => Self::Out,
13			Dir::Both => Self::Both,
14		}
15	}
16}
17
18impl From<crate::expr::Dir> for Dir {
19	fn from(v: crate::expr::Dir) -> Self {
20		match v {
21			crate::expr::Dir::In => Self::In,
22			crate::expr::Dir::Out => Self::Out,
23			crate::expr::Dir::Both => Self::Both,
24		}
25	}
26}