diff options
author | Quentin Dufour <quentin@deuxfleurs.fr> | 2024-03-08 08:43:28 +0100 |
---|---|---|
committer | Quentin Dufour <quentin@deuxfleurs.fr> | 2024-03-08 08:43:28 +0100 |
commit | 1edf0b15ecaa73d55bb72c6f3c6e25d4f231f322 (patch) | |
tree | f69b53af28f2680d2d923add56c1ccb204c96176 /aero-collections | |
parent | 1a43ce5ac7033c148f64a033f2b1d335e95e11d5 (diff) | |
download | aerogramme-1edf0b15ecaa73d55bb72c6f3c6e25d4f231f322.tar.gz aerogramme-1edf0b15ecaa73d55bb72c6f3c6e25d4f231f322.zip |
Re-enable collections
Diffstat (limited to 'aero-collections')
-rw-r--r-- | aero-collections/Cargo.toml | 24 | ||||
-rw-r--r-- | aero-collections/src/calendar/mod.rs | 1 | ||||
-rw-r--r-- | aero-collections/src/lib.rs | 3 | ||||
-rw-r--r-- | aero-collections/src/mail/incoming.rs (renamed from aero-collections/mail/incoming.rs) | 12 | ||||
-rw-r--r-- | aero-collections/src/mail/mailbox.rs (renamed from aero-collections/mail/mailbox.rs) | 11 | ||||
-rw-r--r-- | aero-collections/src/mail/mod.rs (renamed from aero-collections/mail/mod.rs) | 2 | ||||
-rw-r--r-- | aero-collections/src/mail/namespace.rs (renamed from aero-collections/mail/namespace.rs) | 15 | ||||
-rw-r--r-- | aero-collections/src/mail/query.rs (renamed from aero-collections/mail/query.rs) | 0 | ||||
-rw-r--r-- | aero-collections/src/mail/snapshot.rs (renamed from aero-collections/mail/snapshot.rs) | 0 | ||||
-rw-r--r-- | aero-collections/src/mail/uidindex.rs (renamed from aero-collections/mail/uidindex.rs) | 2 | ||||
-rw-r--r-- | aero-collections/src/mail/unique_ident.rs (renamed from aero-collections/mail/unique_ident.rs) | 2 | ||||
-rw-r--r-- | aero-collections/src/user.rs (renamed from aero-collections/user.rs) | 14 |
12 files changed, 51 insertions, 35 deletions
diff --git a/aero-collections/Cargo.toml b/aero-collections/Cargo.toml new file mode 100644 index 0000000..90d285e --- /dev/null +++ b/aero-collections/Cargo.toml @@ -0,0 +1,24 @@ +[package] +name = "aero-collections" +version = "0.3.0" +authors = ["Alex Auvolat <alex@adnab.me>", "Quentin Dufour <quentin@dufour.io>"] +edition = "2021" +license = "EUPL-1.2" +description = "Aerogramme own representation of the different objects it manipulates" + +[dependencies] +aero-user.workspace = true +aero-bayou.workspace = true + +anyhow.workspace = true +base64.workspace = true +futures.workspace = true +lazy_static.workspace = true +serde.workspace = true +hex.workspace = true +tokio.workspace = true +tracing.workspace = true +rand.workspace = true +im.workspace = true +sodiumoxide.workspace = true +eml-codec.workspace = true diff --git a/aero-collections/src/calendar/mod.rs b/aero-collections/src/calendar/mod.rs new file mode 100644 index 0000000..19e3340 --- /dev/null +++ b/aero-collections/src/calendar/mod.rs @@ -0,0 +1 @@ +//@FIXME Event Index diff --git a/aero-collections/src/lib.rs b/aero-collections/src/lib.rs new file mode 100644 index 0000000..adcfc93 --- /dev/null +++ b/aero-collections/src/lib.rs @@ -0,0 +1,3 @@ +pub mod user; +pub mod mail; +pub mod calendar; diff --git a/aero-collections/mail/incoming.rs b/aero-collections/src/mail/incoming.rs index e2ad97d..8220461 100644 --- a/aero-collections/mail/incoming.rs +++ b/aero-collections/src/mail/incoming.rs @@ -1,6 +1,3 @@ -//use std::collections::HashMap; -use std::convert::TryFrom; - use std::sync::{Arc, Weak}; use std::time::Duration; @@ -11,15 +8,16 @@ use futures::{future::BoxFuture, FutureExt}; use tokio::sync::watch; use tracing::{debug, error, info, warn}; -use crate::cryptoblob; -use crate::login::{Credentials, PublicCredentials}; +use aero_user::cryptoblob; +use aero_user::login::{Credentials, PublicCredentials}; +use aero_user::storage; +use aero_bayou::timestamp::now_msec; + use crate::mail::mailbox::Mailbox; use crate::mail::uidindex::ImapUidvalidity; use crate::mail::unique_ident::*; use crate::user::User; use crate::mail::IMF; -use crate::storage; -use crate::timestamp::now_msec; const INCOMING_PK: &str = "incoming"; const INCOMING_LOCK_SK: &str = "lock"; diff --git a/aero-collections/mail/mailbox.rs b/aero-collections/src/mail/mailbox.rs index d1a5473..a767678 100644 --- a/aero-collections/mail/mailbox.rs +++ b/aero-collections/src/mail/mailbox.rs @@ -2,14 +2,15 @@ use anyhow::{anyhow, bail, Result}; use serde::{Deserialize, Serialize}; use tokio::sync::RwLock; -use crate::bayou::Bayou; -use crate::cryptoblob::{self, gen_key, open_deserialize, seal_serialize, Key}; -use crate::login::Credentials; +use aero_user::cryptoblob::{self, gen_key, open_deserialize, seal_serialize, Key}; +use aero_user::login::Credentials; +use aero_user::storage::{self, BlobRef, BlobVal, RowRef, RowVal, Selector, Store}; +use aero_bayou::Bayou; +use aero_bayou::timestamp::now_msec; + use crate::mail::uidindex::*; use crate::mail::unique_ident::*; use crate::mail::IMF; -use crate::storage::{self, BlobRef, BlobVal, RowRef, RowVal, Selector, Store}; -use crate::timestamp::now_msec; pub struct Mailbox { pub(super) id: UniqueIdent, diff --git a/aero-collections/mail/mod.rs b/aero-collections/src/mail/mod.rs index 03e85cd..85361f3 100644 --- a/aero-collections/mail/mod.rs +++ b/aero-collections/src/mail/mod.rs @@ -1,5 +1,3 @@ -use std::convert::TryFrom; - pub mod incoming; pub mod mailbox; pub mod query; diff --git a/aero-collections/mail/namespace.rs b/aero-collections/src/mail/namespace.rs index 5e67173..452ac68 100644 --- a/aero-collections/mail/namespace.rs +++ b/aero-collections/src/mail/namespace.rs @@ -1,19 +1,12 @@ -use std::collections::{BTreeMap, HashMap}; -use std::sync::{Arc, Weak}; +use std::collections::BTreeMap; -use anyhow::{anyhow, bail, Result}; -use lazy_static::lazy_static; +use anyhow::{bail, Result}; use serde::{Deserialize, Serialize}; -use tokio::sync::watch; -use crate::cryptoblob::{open_deserialize, seal_serialize}; -use crate::login::Credentials; -use crate::mail::incoming::incoming_mail_watch_process; -use crate::mail::mailbox::Mailbox; +use aero_bayou::timestamp::now_msec; + use crate::mail::uidindex::ImapUidvalidity; use crate::mail::unique_ident::{gen_ident, UniqueIdent}; -use crate::storage; -use crate::timestamp::now_msec; pub const MAILBOX_HIERARCHY_DELIMITER: char = '.'; diff --git a/aero-collections/mail/query.rs b/aero-collections/src/mail/query.rs index 3e6fe99..3e6fe99 100644 --- a/aero-collections/mail/query.rs +++ b/aero-collections/src/mail/query.rs diff --git a/aero-collections/mail/snapshot.rs b/aero-collections/src/mail/snapshot.rs index ed756b5..ed756b5 100644 --- a/aero-collections/mail/snapshot.rs +++ b/aero-collections/src/mail/snapshot.rs diff --git a/aero-collections/mail/uidindex.rs b/aero-collections/src/mail/uidindex.rs index 5a06670..637a1ac 100644 --- a/aero-collections/mail/uidindex.rs +++ b/aero-collections/src/mail/uidindex.rs @@ -3,7 +3,7 @@ use std::num::{NonZeroU32, NonZeroU64}; use im::{HashMap, OrdMap, OrdSet}; use serde::{Deserialize, Deserializer, Serialize, Serializer}; -use crate::bayou::*; +use aero_bayou::*; use crate::mail::unique_ident::UniqueIdent; pub type ModSeq = NonZeroU64; diff --git a/aero-collections/mail/unique_ident.rs b/aero-collections/src/mail/unique_ident.rs index 0e629db..0987a2c 100644 --- a/aero-collections/mail/unique_ident.rs +++ b/aero-collections/src/mail/unique_ident.rs @@ -5,7 +5,7 @@ use lazy_static::lazy_static; use rand::prelude::*; use serde::{de::Error, Deserialize, Deserializer, Serialize, Serializer}; -use crate::timestamp::now_msec; +use aero_bayou::timestamp::now_msec; /// An internal Mail Identifier is composed of two components: /// - a process identifier, 128 bits, itself composed of: diff --git a/aero-collections/user.rs b/aero-collections/src/user.rs index a38b9c1..193ce90 100644 --- a/aero-collections/user.rs +++ b/aero-collections/src/user.rs @@ -1,20 +1,18 @@ -use std::collections::{BTreeMap, HashMap}; +use std::collections::HashMap; use std::sync::{Arc, Weak}; use anyhow::{anyhow, bail, Result}; use lazy_static::lazy_static; -use serde::{Deserialize, Serialize}; use tokio::sync::watch; -use crate::cryptoblob::{open_deserialize, seal_serialize}; -use crate::login::Credentials; +use aero_user::cryptoblob::{open_deserialize, seal_serialize}; +use aero_user::login::Credentials; +use aero_user::storage; + use crate::mail::incoming::incoming_mail_watch_process; use crate::mail::mailbox::Mailbox; use crate::mail::uidindex::ImapUidvalidity; -use crate::mail::unique_ident::{gen_ident, UniqueIdent}; -use crate::storage; -use crate::timestamp::now_msec; - +use crate::mail::unique_ident::UniqueIdent; use crate::mail::namespace::{MAILBOX_HIERARCHY_DELIMITER, INBOX, DRAFTS, ARCHIVE, SENT, TRASH, MAILBOX_LIST_PK, MAILBOX_LIST_SK,MailboxList,CreatedMailbox}; //@FIXME User should be totally rewriten |