es_entity/
lib.rs

1#![cfg_attr(feature = "fail-on-warnings", deny(warnings))]
2#![cfg_attr(feature = "fail-on-warnings", deny(clippy::all))]
3
4mod error;
5mod events;
6mod idempotent;
7mod macros;
8mod nested;
9mod operation;
10mod query;
11mod traits;
12
13pub mod prelude {
14    pub use async_trait;
15    pub use chrono;
16    pub use serde_json;
17    pub use sqlx;
18    pub use uuid;
19}
20
21pub use error::*;
22pub use es_entity_macros::expand_es_query;
23pub use es_entity_macros::retry_on_concurrent_modification;
24pub use es_entity_macros::EsEntity;
25pub use es_entity_macros::EsEvent;
26pub use es_entity_macros::EsRepo;
27pub use events::*;
28pub use idempotent::*;
29pub use nested::*;
30pub use operation::*;
31pub use query::*;
32pub use traits::*;
33
34#[cfg(feature = "graphql")]
35pub mod graphql {
36    pub use async_graphql;
37    pub use base64;
38
39    #[derive(Debug, serde::Serialize, serde::Deserialize, Clone, Copy)]
40    #[serde(transparent)]
41    pub struct UUID(crate::prelude::uuid::Uuid);
42    async_graphql::scalar!(UUID);
43    impl<T: Into<crate::prelude::uuid::Uuid>> From<T> for UUID {
44        fn from(id: T) -> Self {
45            let uuid = id.into();
46            Self(uuid)
47        }
48    }
49    impl From<&UUID> for crate::prelude::uuid::Uuid {
50        fn from(id: &UUID) -> Self {
51            id.0
52        }
53    }
54}