use unambiguous crate uses
This commit is contained in:
@@ -1,10 +1,10 @@
|
|||||||
use anyhow::{Context, Error, Result};
|
use ::anyhow::{Context, Error, Result};
|
||||||
use async_trait::async_trait;
|
use ::async_trait::async_trait;
|
||||||
use crdt_enc::{key_cryptor::Keys, utils::VersionBytes, CoreSubHandle, Info};
|
use ::crdt_enc::{key_cryptor::Keys, utils::VersionBytes, CoreSubHandle, Info};
|
||||||
use crdts::{CmRDT, CvRDT, MVReg, Orswot};
|
use ::crdts::{CmRDT, CvRDT, MVReg, Orswot};
|
||||||
use serde::{Deserialize, Serialize};
|
use ::serde::{Deserialize, Serialize};
|
||||||
use std::{convert::Infallible, fmt::Debug, sync::Mutex as SyncMutex};
|
use ::std::{convert::Infallible, fmt::Debug, sync::Mutex as SyncMutex};
|
||||||
use uuid::Uuid;
|
use ::uuid::Uuid;
|
||||||
|
|
||||||
pub fn init() {
|
pub fn init() {
|
||||||
gpgme::init();
|
gpgme::init();
|
||||||
|
|||||||
@@ -1,10 +1,10 @@
|
|||||||
use anyhow::{Context, Error, Result};
|
use ::anyhow::{Context, Error, Result};
|
||||||
use async_trait::async_trait;
|
use ::async_trait::async_trait;
|
||||||
use crdt_enc::utils::{VersionBytes, VersionBytesRef};
|
use ::crdt_enc::utils::{VersionBytes, VersionBytesRef};
|
||||||
use serde::{Deserialize, Serialize};
|
use ::serde::{Deserialize, Serialize};
|
||||||
use sodiumoxide::crypto::secretbox;
|
use ::sodiumoxide::crypto::secretbox;
|
||||||
use std::{borrow::Cow, fmt::Debug};
|
use ::std::{borrow::Cow, fmt::Debug};
|
||||||
use uuid::Uuid;
|
use ::uuid::Uuid;
|
||||||
|
|
||||||
const DATA_VERSION: Uuid = Uuid::from_u128(0xc7f269be_0ff5_4a77_99c3_7c23c96d5cb4);
|
const DATA_VERSION: Uuid = Uuid::from_u128(0xc7f269be_0ff5_4a77_99c3_7c23c96d5cb4);
|
||||||
|
|
||||||
|
|||||||
@@ -1,24 +1,24 @@
|
|||||||
|
use ::anyhow::{ensure, Context, Error, Result};
|
||||||
|
use ::async_trait::async_trait;
|
||||||
use ::bytes::Buf;
|
use ::bytes::Buf;
|
||||||
use anyhow::{ensure, Context, Error, Result};
|
use ::crdt_enc::utils::{VersionBytes, VersionBytesRef};
|
||||||
use async_trait::async_trait;
|
use ::futures::{
|
||||||
use crdt_enc::utils::{VersionBytes, VersionBytesRef};
|
|
||||||
use futures::{
|
|
||||||
future::{Either, TryFutureExt},
|
future::{Either, TryFutureExt},
|
||||||
stream::{self, Stream, StreamExt, TryStreamExt},
|
stream::{self, Stream, StreamExt, TryStreamExt},
|
||||||
};
|
};
|
||||||
use std::{
|
use ::std::{
|
||||||
convert::TryFrom,
|
convert::TryFrom,
|
||||||
fmt::Debug,
|
fmt::Debug,
|
||||||
path::{Path, PathBuf},
|
path::{Path, PathBuf},
|
||||||
str::FromStr,
|
str::FromStr,
|
||||||
};
|
};
|
||||||
use tiny_keccak::{Hasher, Sha3};
|
use ::tiny_keccak::{Hasher, Sha3};
|
||||||
use tokio::{
|
use ::tokio::{
|
||||||
fs,
|
fs,
|
||||||
io::{self, AsyncWriteExt},
|
io::{self, AsyncWriteExt},
|
||||||
};
|
};
|
||||||
use tokio_stream::wrappers::ReadDirStream;
|
use ::tokio_stream::wrappers::ReadDirStream;
|
||||||
use uuid::Uuid;
|
use ::uuid::Uuid;
|
||||||
|
|
||||||
#[derive(Debug)]
|
#[derive(Debug)]
|
||||||
pub struct Storage {
|
pub struct Storage {
|
||||||
|
|||||||
@@ -2,11 +2,11 @@ use crate::{
|
|||||||
utils::{VersionBytes, VersionBytesRef},
|
utils::{VersionBytes, VersionBytesRef},
|
||||||
CoreSubHandle, Info,
|
CoreSubHandle, Info,
|
||||||
};
|
};
|
||||||
use anyhow::Result;
|
use ::anyhow::Result;
|
||||||
use async_trait::async_trait;
|
use ::async_trait::async_trait;
|
||||||
use crdts::MVReg;
|
use ::crdts::MVReg;
|
||||||
use std::fmt::Debug;
|
use ::std::fmt::Debug;
|
||||||
use uuid::Uuid;
|
use ::uuid::Uuid;
|
||||||
|
|
||||||
#[async_trait]
|
#[async_trait]
|
||||||
pub trait Cryptor
|
pub trait Cryptor
|
||||||
|
|||||||
@@ -2,18 +2,18 @@ use crate::{
|
|||||||
utils::{VersionBytes, VersionBytesRef},
|
utils::{VersionBytes, VersionBytesRef},
|
||||||
CoreSubHandle, Info,
|
CoreSubHandle, Info,
|
||||||
};
|
};
|
||||||
use anyhow::Result;
|
use ::anyhow::Result;
|
||||||
use async_trait::async_trait;
|
use ::async_trait::async_trait;
|
||||||
use crdts::{CmRDT, CvRDT, MVReg, Orswot};
|
use ::crdts::{CmRDT, CvRDT, MVReg, Orswot};
|
||||||
use serde::{Deserialize, Serialize};
|
use ::serde::{Deserialize, Serialize};
|
||||||
use std::{
|
use ::std::{
|
||||||
borrow::Borrow,
|
borrow::Borrow,
|
||||||
cmp::{Eq, Ord, Ordering, PartialEq},
|
cmp::{Eq, Ord, Ordering, PartialEq},
|
||||||
convert::Infallible,
|
convert::Infallible,
|
||||||
fmt::Debug,
|
fmt::Debug,
|
||||||
hash::{Hash, Hasher},
|
hash::{Hash, Hasher},
|
||||||
};
|
};
|
||||||
use uuid::Uuid;
|
use ::uuid::Uuid;
|
||||||
|
|
||||||
#[async_trait]
|
#[async_trait]
|
||||||
pub trait KeyCryptor
|
pub trait KeyCryptor
|
||||||
|
|||||||
@@ -9,16 +9,16 @@ use crate::{
|
|||||||
storage::Storage,
|
storage::Storage,
|
||||||
utils::{VersionBytes, VersionBytesRef},
|
utils::{VersionBytes, VersionBytesRef},
|
||||||
};
|
};
|
||||||
use anyhow::{Context, Error, Result};
|
use ::anyhow::{Context, Error, Result};
|
||||||
use async_trait::async_trait;
|
use ::async_trait::async_trait;
|
||||||
use crdts::{CmRDT, CvRDT, MVReg, VClock};
|
use ::crdts::{CmRDT, CvRDT, MVReg, VClock};
|
||||||
use dyn_clone::DynClone;
|
use ::dyn_clone::DynClone;
|
||||||
use futures::{
|
use ::futures::{
|
||||||
lock::Mutex as AsyncMutex,
|
lock::Mutex as AsyncMutex,
|
||||||
stream::{self, StreamExt, TryStreamExt},
|
stream::{self, StreamExt, TryStreamExt},
|
||||||
};
|
};
|
||||||
use serde::{de::DeserializeOwned, Deserialize, Serialize};
|
use ::serde::{de::DeserializeOwned, Deserialize, Serialize};
|
||||||
use std::{
|
use ::std::{
|
||||||
collections::HashSet,
|
collections::HashSet,
|
||||||
convert::Infallible,
|
convert::Infallible,
|
||||||
default::Default,
|
default::Default,
|
||||||
@@ -26,7 +26,7 @@ use std::{
|
|||||||
mem,
|
mem,
|
||||||
sync::{Arc, Mutex as SyncMutex},
|
sync::{Arc, Mutex as SyncMutex},
|
||||||
};
|
};
|
||||||
use uuid::Uuid;
|
use ::uuid::Uuid;
|
||||||
|
|
||||||
const CURRENT_VERSION: Uuid = Uuid::from_u128(0xe834d789_101b_4634_9823_9de990a9051f);
|
const CURRENT_VERSION: Uuid = Uuid::from_u128(0xe834d789_101b_4634_9823_9de990a9051f);
|
||||||
|
|
||||||
|
|||||||
@@ -1,9 +1,9 @@
|
|||||||
use crate::{utils::VersionBytes, CoreSubHandle, Info};
|
use crate::{utils::VersionBytes, CoreSubHandle, Info};
|
||||||
use anyhow::Result;
|
use ::anyhow::Result;
|
||||||
use async_trait::async_trait;
|
use ::async_trait::async_trait;
|
||||||
use crdts::MVReg;
|
use ::crdts::MVReg;
|
||||||
use std::fmt::Debug;
|
use ::std::fmt::Debug;
|
||||||
use uuid::Uuid;
|
use ::uuid::Uuid;
|
||||||
|
|
||||||
#[async_trait]
|
#[async_trait]
|
||||||
pub trait Storage
|
pub trait Storage
|
||||||
|
|||||||
@@ -2,9 +2,9 @@ mod version_bytes;
|
|||||||
|
|
||||||
pub use version_bytes::*;
|
pub use version_bytes::*;
|
||||||
|
|
||||||
use crdts::{CmRDT, CvRDT};
|
use ::crdts::{CmRDT, CvRDT};
|
||||||
use serde::{Deserialize, Serialize};
|
use ::serde::{Deserialize, Serialize};
|
||||||
use std::convert::Infallible;
|
use ::std::convert::Infallible;
|
||||||
|
|
||||||
#[derive(Debug, Clone, Default, Serialize, Deserialize)]
|
#[derive(Debug, Clone, Default, Serialize, Deserialize)]
|
||||||
pub struct EmptyCrdt;
|
pub struct EmptyCrdt;
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
use bytes::Buf;
|
use ::bytes::Buf;
|
||||||
use serde::{Deserialize, Serialize};
|
use ::serde::{Deserialize, Serialize};
|
||||||
use std::{borrow::Cow, convert::TryFrom, fmt, io::IoSlice};
|
use ::std::{borrow::Cow, convert::TryFrom, fmt, io::IoSlice};
|
||||||
use uuid::Uuid;
|
use ::uuid::Uuid;
|
||||||
|
|
||||||
#[derive(Debug)]
|
#[derive(Debug)]
|
||||||
pub struct VersionError {
|
pub struct VersionError {
|
||||||
|
|||||||
@@ -1,8 +1,8 @@
|
|||||||
use anyhow::Result;
|
use ::anyhow::Result;
|
||||||
use crdt_enc_gpgme::KeyHandler;
|
use ::crdt_enc_gpgme::KeyHandler;
|
||||||
use crdt_enc_sodium::EncHandler;
|
use ::crdt_enc_sodium::EncHandler;
|
||||||
use crdt_enc_tokio::Storage;
|
use ::crdt_enc_tokio::Storage;
|
||||||
use uuid::Uuid;
|
use ::uuid::Uuid;
|
||||||
|
|
||||||
const CURRENT_DATA_VERSION: Uuid = Uuid::from_u128(0xaadfd5a6_6e19_4b24_a802_4fa27c72f20c);
|
const CURRENT_DATA_VERSION: Uuid = Uuid::from_u128(0xaadfd5a6_6e19_4b24_a802_4fa27c72f20c);
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user