Skip to main content

surrealdb_expr/expr/convert/
access.rs

1//! `sql` -> `expr` conversions for [`crate::sql::access`].
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::access::*;
7
8impl From<AccessDuration> for crate::expr::access::AccessDuration {
9	fn from(v: AccessDuration) -> Self {
10		Self {
11			grant: v.grant.into(),
12			token: v.token.into(),
13			session: v.session.into(),
14		}
15	}
16}
17
18impl From<crate::expr::access::AccessDuration> for AccessDuration {
19	fn from(v: crate::expr::access::AccessDuration) -> Self {
20		Self {
21			grant: v.grant.into(),
22			token: v.token.into(),
23			session: v.session.into(),
24		}
25	}
26}