run cargo fix for rust 2024 changes and rustfmt
Signed-off-by: June Clementine Strawberry <strawberry@puppygock.gay>
This commit is contained in:
parent
e97952b7f6
commit
a1e1f40ded
320 changed files with 2212 additions and 2039 deletions
|
@ -1,10 +1,9 @@
|
|||
use conduwuit::{
|
||||
arrayvec::ArrayVec, checked, debug::DebugInspect, err, utils::string, Error, Result,
|
||||
Error, Result, arrayvec::ArrayVec, checked, debug::DebugInspect, err, utils::string,
|
||||
};
|
||||
use serde::{
|
||||
de,
|
||||
Deserialize, de,
|
||||
de::{DeserializeSeed, Visitor},
|
||||
Deserialize,
|
||||
};
|
||||
|
||||
use crate::util::unhandled;
|
||||
|
|
|
@ -12,21 +12,21 @@ mod repair;
|
|||
use std::{
|
||||
ffi::CStr,
|
||||
sync::{
|
||||
atomic::{AtomicU32, Ordering},
|
||||
Arc,
|
||||
atomic::{AtomicU32, Ordering},
|
||||
},
|
||||
};
|
||||
|
||||
use conduwuit::{debug, info, warn, Err, Result};
|
||||
use conduwuit::{Err, Result, debug, info, warn};
|
||||
use rocksdb::{
|
||||
AsColumnFamilyRef, BoundColumnFamily, DBCommon, DBWithThreadMode, MultiThreaded,
|
||||
WaitForCompactOptions,
|
||||
};
|
||||
|
||||
use crate::{
|
||||
Context,
|
||||
pool::Pool,
|
||||
util::{map_err, result},
|
||||
Context,
|
||||
};
|
||||
|
||||
pub struct Engine {
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
use std::fmt::Write;
|
||||
|
||||
use conduwuit::{error, implement, info, utils::time::rfc2822_from_seconds, warn, Result};
|
||||
use conduwuit::{Result, error, implement, info, utils::time::rfc2822_from_seconds, warn};
|
||||
use rocksdb::backup::{BackupEngine, BackupEngineOptions};
|
||||
|
||||
use super::Engine;
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
use conduwuit::{err, utils::math::Expected, Config, Result};
|
||||
use conduwuit::{Config, Result, err, utils::math::Expected};
|
||||
use rocksdb::{
|
||||
BlockBasedIndexType, BlockBasedOptions, BlockBasedPinningTier, Cache,
|
||||
DBCompressionType as CompressionType, DataBlockIndexType, LruCacheOptions, Options,
|
||||
|
@ -6,7 +6,7 @@ use rocksdb::{
|
|||
};
|
||||
|
||||
use super::descriptor::{CacheDisp, Descriptor};
|
||||
use crate::{util::map_err, Context};
|
||||
use crate::{Context, util::map_err};
|
||||
|
||||
pub(super) const SENTINEL_COMPRESSION_LEVEL: i32 = 32767;
|
||||
|
||||
|
|
|
@ -3,7 +3,7 @@ use std::{
|
|||
sync::{Arc, Mutex},
|
||||
};
|
||||
|
||||
use conduwuit::{debug, utils::math::usize_from_f64, Result, Server};
|
||||
use conduwuit::{Result, Server, debug, utils::math::usize_from_f64};
|
||||
use rocksdb::{Cache, Env, LruCacheOptions};
|
||||
|
||||
use crate::{or_else, pool::Pool};
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
use std::{cmp, convert::TryFrom};
|
||||
|
||||
use conduwuit::{utils, Config, Result};
|
||||
use rocksdb::{statistics::StatsLevel, Cache, DBRecoveryMode, Env, LogLevel, Options};
|
||||
use conduwuit::{Config, Result, utils};
|
||||
use rocksdb::{Cache, DBRecoveryMode, Env, LogLevel, Options, statistics::StatsLevel};
|
||||
|
||||
use super::{cf_opts::cache_size_f64, logger::handle as handle_log};
|
||||
|
||||
|
|
|
@ -1,11 +1,11 @@
|
|||
use conduwuit::{implement, Result};
|
||||
use conduwuit::{Result, implement};
|
||||
use rocksdb::LiveFile as SstFile;
|
||||
|
||||
use super::Engine;
|
||||
use crate::util::map_err;
|
||||
|
||||
#[implement(Engine)]
|
||||
pub fn file_list(&self) -> impl Iterator<Item = Result<SstFile>> + Send {
|
||||
pub fn file_list(&self) -> impl Iterator<Item = Result<SstFile>> + Send + use<> {
|
||||
self.db
|
||||
.live_files()
|
||||
.map_err(map_err)
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
use std::fmt::Write;
|
||||
|
||||
use conduwuit::{implement, Result};
|
||||
use conduwuit::{Result, implement};
|
||||
use rocksdb::perf::get_memory_usage_stats;
|
||||
|
||||
use super::Engine;
|
||||
|
|
|
@ -1,20 +1,20 @@
|
|||
use std::{
|
||||
collections::BTreeSet,
|
||||
path::Path,
|
||||
sync::{atomic::AtomicU32, Arc},
|
||||
sync::{Arc, atomic::AtomicU32},
|
||||
};
|
||||
|
||||
use conduwuit::{debug, implement, info, warn, Result};
|
||||
use conduwuit::{Result, debug, implement, info, warn};
|
||||
use rocksdb::{ColumnFamilyDescriptor, Options};
|
||||
|
||||
use super::{
|
||||
Db, Engine,
|
||||
cf_opts::cf_options,
|
||||
db_opts::db_options,
|
||||
descriptor::{self, Descriptor},
|
||||
repair::repair,
|
||||
Db, Engine,
|
||||
};
|
||||
use crate::{or_else, Context};
|
||||
use crate::{Context, or_else};
|
||||
|
||||
#[implement(Engine)]
|
||||
#[tracing::instrument(skip_all)]
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
use std::path::PathBuf;
|
||||
|
||||
use conduwuit::{info, warn, Err, Result};
|
||||
use conduwuit::{Err, Result, info, warn};
|
||||
use rocksdb::Options;
|
||||
|
||||
use super::Db;
|
||||
|
|
|
@ -4,7 +4,7 @@ use conduwuit::Result;
|
|||
use rocksdb::DBPinnableSlice;
|
||||
use serde::{Deserialize, Serialize, Serializer};
|
||||
|
||||
use crate::{keyval::deserialize_val, Deserialized, Slice};
|
||||
use crate::{Deserialized, Slice, keyval::deserialize_val};
|
||||
|
||||
pub struct Handle<'a> {
|
||||
val: DBPinnableSlice<'a>,
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
use conduwuit::{smallvec::SmallVec, Result};
|
||||
use conduwuit::{Result, smallvec::SmallVec};
|
||||
use serde::{Deserialize, Serialize};
|
||||
|
||||
use crate::{de, ser};
|
||||
|
|
|
@ -40,7 +40,7 @@ pub(crate) use self::options::{
|
|||
read_options_default, write_options_default,
|
||||
};
|
||||
pub use self::{get_batch::Get, qry_batch::Qry};
|
||||
use crate::{watchers::Watchers, Engine};
|
||||
use crate::{Engine, watchers::Watchers};
|
||||
|
||||
pub struct Map {
|
||||
name: &'static str,
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
use conduwuit::{implement, Err, Result};
|
||||
use conduwuit::{Err, Result, implement};
|
||||
use rocksdb::{BottommostLevelCompaction, CompactOptions};
|
||||
|
||||
use crate::keyval::KeyBuf;
|
||||
|
|
|
@ -1,10 +1,10 @@
|
|||
use std::{convert::AsRef, fmt::Debug, future::Future, io::Write, sync::Arc};
|
||||
|
||||
use conduwuit::{
|
||||
Result,
|
||||
arrayvec::ArrayVec,
|
||||
err, implement,
|
||||
utils::{future::TryExtExt, result::FlatOk},
|
||||
Result,
|
||||
};
|
||||
use futures::FutureExt;
|
||||
use serde::Serialize;
|
||||
|
@ -16,7 +16,10 @@ use crate::{keyval::KeyBuf, ser};
|
|||
/// - harder errors may not be reported
|
||||
#[inline]
|
||||
#[implement(super::Map)]
|
||||
pub fn contains<K>(self: &Arc<Self>, key: &K) -> impl Future<Output = bool> + Send + '_
|
||||
pub fn contains<K>(
|
||||
self: &Arc<Self>,
|
||||
key: &K,
|
||||
) -> impl Future<Output = bool> + Send + '_ + use<'_, K>
|
||||
where
|
||||
K: Serialize + ?Sized + Debug,
|
||||
{
|
||||
|
@ -32,7 +35,7 @@ where
|
|||
pub fn acontains<const MAX: usize, K>(
|
||||
self: &Arc<Self>,
|
||||
key: &K,
|
||||
) -> impl Future<Output = bool> + Send + '_
|
||||
) -> impl Future<Output = bool> + Send + '_ + use<'_, MAX, K>
|
||||
where
|
||||
K: Serialize + ?Sized + Debug,
|
||||
{
|
||||
|
@ -49,7 +52,7 @@ pub fn bcontains<K, B>(
|
|||
self: &Arc<Self>,
|
||||
key: &K,
|
||||
buf: &mut B,
|
||||
) -> impl Future<Output = bool> + Send + '_
|
||||
) -> impl Future<Output = bool> + Send + '_ + use<'_, K, B>
|
||||
where
|
||||
K: Serialize + ?Sized + Debug,
|
||||
B: Write + AsRef<[u8]>,
|
||||
|
@ -62,7 +65,10 @@ where
|
|||
/// - key is raw
|
||||
#[inline]
|
||||
#[implement(super::Map)]
|
||||
pub fn exists<'a, K>(self: &'a Arc<Self>, key: &K) -> impl Future<Output = Result> + Send + 'a
|
||||
pub fn exists<'a, K>(
|
||||
self: &'a Arc<Self>,
|
||||
key: &K,
|
||||
) -> impl Future<Output = Result> + Send + 'a + use<'a, K>
|
||||
where
|
||||
K: AsRef<[u8]> + ?Sized + Debug + 'a,
|
||||
{
|
||||
|
|
|
@ -16,7 +16,10 @@ pub fn count(self: &Arc<Self>) -> impl Future<Output = usize> + Send + '_ {
|
|||
/// - From is a structured key
|
||||
#[implement(super::Map)]
|
||||
#[inline]
|
||||
pub fn count_from<'a, P>(self: &'a Arc<Self>, from: &P) -> impl Future<Output = usize> + Send + 'a
|
||||
pub fn count_from<'a, P>(
|
||||
self: &'a Arc<Self>,
|
||||
from: &P,
|
||||
) -> impl Future<Output = usize> + Send + 'a + use<'a, P>
|
||||
where
|
||||
P: Serialize + ?Sized + Debug + 'a,
|
||||
{
|
||||
|
@ -46,7 +49,7 @@ where
|
|||
pub fn count_prefix<'a, P>(
|
||||
self: &'a Arc<Self>,
|
||||
prefix: &P,
|
||||
) -> impl Future<Output = usize> + Send + 'a
|
||||
) -> impl Future<Output = usize> + Send + 'a + use<'a, P>
|
||||
where
|
||||
P: Serialize + ?Sized + Debug + 'a,
|
||||
{
|
||||
|
|
|
@ -1,20 +1,23 @@
|
|||
use std::{convert::AsRef, fmt::Debug, sync::Arc};
|
||||
|
||||
use conduwuit::{err, implement, utils::result::MapExpect, Err, Result};
|
||||
use futures::{future::ready, Future, FutureExt, TryFutureExt};
|
||||
use conduwuit::{Err, Result, err, implement, utils::result::MapExpect};
|
||||
use futures::{Future, FutureExt, TryFutureExt, future::ready};
|
||||
use rocksdb::{DBPinnableSlice, ReadOptions};
|
||||
use tokio::task;
|
||||
|
||||
use crate::{
|
||||
util::{is_incomplete, map_err, or_else},
|
||||
Handle,
|
||||
util::{is_incomplete, map_err, or_else},
|
||||
};
|
||||
|
||||
/// Fetch a value from the database into cache, returning a reference-handle
|
||||
/// asynchronously. The key is referenced directly to perform the query.
|
||||
#[implement(super::Map)]
|
||||
#[tracing::instrument(skip(self, key), fields(%self), level = "trace")]
|
||||
pub fn get<K>(self: &Arc<Self>, key: &K) -> impl Future<Output = Result<Handle<'_>>> + Send
|
||||
pub fn get<K>(
|
||||
self: &Arc<Self>,
|
||||
key: &K,
|
||||
) -> impl Future<Output = Result<Handle<'_>>> + Send + use<'_, K>
|
||||
where
|
||||
K: AsRef<[u8]> + Debug + ?Sized,
|
||||
{
|
||||
|
|
|
@ -1,12 +1,11 @@
|
|||
use std::{convert::AsRef, sync::Arc};
|
||||
|
||||
use conduwuit::{
|
||||
implement,
|
||||
Result, implement,
|
||||
utils::{
|
||||
stream::{automatic_amplification, automatic_width, WidebandExt},
|
||||
IterStream,
|
||||
stream::{WidebandExt, automatic_amplification, automatic_width},
|
||||
},
|
||||
Result,
|
||||
};
|
||||
use futures::{Stream, StreamExt, TryStreamExt};
|
||||
use rocksdb::{DBPinnableSlice, ReadOptions};
|
||||
|
@ -64,7 +63,7 @@ where
|
|||
pub(crate) fn get_batch_cached<'a, I, K>(
|
||||
&self,
|
||||
keys: I,
|
||||
) -> impl Iterator<Item = Result<Option<Handle<'_>>>> + Send
|
||||
) -> impl Iterator<Item = Result<Option<Handle<'_>>>> + Send + use<'_, I, K>
|
||||
where
|
||||
I: Iterator<Item = &'a K> + ExactSizeIterator + Send,
|
||||
K: AsRef<[u8]> + Send + ?Sized + Sync + 'a,
|
||||
|
@ -78,7 +77,7 @@ where
|
|||
pub(crate) fn get_batch_blocking<'a, I, K>(
|
||||
&self,
|
||||
keys: I,
|
||||
) -> impl Iterator<Item = Result<Handle<'_>>> + Send
|
||||
) -> impl Iterator<Item = Result<Handle<'_>>> + Send + use<'_, I, K>
|
||||
where
|
||||
I: Iterator<Item = &'a K> + ExactSizeIterator + Send,
|
||||
K: AsRef<[u8]> + Send + ?Sized + Sync + 'a,
|
||||
|
@ -92,7 +91,7 @@ fn get_batch_blocking_opts<'a, I, K>(
|
|||
&self,
|
||||
keys: I,
|
||||
read_options: &ReadOptions,
|
||||
) -> impl Iterator<Item = Result<Option<DBPinnableSlice<'_>>, rocksdb::Error>> + Send
|
||||
) -> impl Iterator<Item = Result<Option<DBPinnableSlice<'_>>, rocksdb::Error>> + Send + use<'_, I, K>
|
||||
where
|
||||
I: Iterator<Item = &'a K> + ExactSizeIterator + Send,
|
||||
K: AsRef<[u8]> + Send + ?Sized + Sync + 'a,
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
use std::sync::Arc;
|
||||
|
||||
use conduwuit::{implement, Result};
|
||||
use conduwuit::{Result, implement};
|
||||
use futures::{FutureExt, Stream, StreamExt, TryFutureExt, TryStreamExt};
|
||||
use rocksdb::Direction;
|
||||
use serde::Deserialize;
|
||||
|
|
|
@ -1,13 +1,13 @@
|
|||
use std::{convert::AsRef, fmt::Debug, sync::Arc};
|
||||
|
||||
use conduwuit::{implement, Result};
|
||||
use conduwuit::{Result, implement};
|
||||
use futures::{FutureExt, Stream, StreamExt, TryFutureExt, TryStreamExt};
|
||||
use rocksdb::Direction;
|
||||
use serde::{Deserialize, Serialize};
|
||||
|
||||
use super::stream_from::is_cached;
|
||||
use crate::{
|
||||
keyval::{result_deserialize_key, serialize_key, Key},
|
||||
keyval::{Key, result_deserialize_key, serialize_key},
|
||||
stream,
|
||||
};
|
||||
|
||||
|
@ -15,7 +15,7 @@ use crate::{
|
|||
pub fn keys_from<'a, K, P>(
|
||||
self: &'a Arc<Self>,
|
||||
from: &P,
|
||||
) -> impl Stream<Item = Result<Key<'_, K>>> + Send
|
||||
) -> impl Stream<Item = Result<Key<'_, K>>> + Send + use<'a, K, P>
|
||||
where
|
||||
P: Serialize + ?Sized + Debug,
|
||||
K: Deserialize<'a> + Send,
|
||||
|
@ -25,7 +25,10 @@ where
|
|||
|
||||
#[implement(super::Map)]
|
||||
#[tracing::instrument(skip(self), level = "trace")]
|
||||
pub fn keys_from_raw<P>(self: &Arc<Self>, from: &P) -> impl Stream<Item = Result<Key<'_>>> + Send
|
||||
pub fn keys_from_raw<P>(
|
||||
self: &Arc<Self>,
|
||||
from: &P,
|
||||
) -> impl Stream<Item = Result<Key<'_>>> + Send + use<'_, P>
|
||||
where
|
||||
P: Serialize + ?Sized + Debug,
|
||||
{
|
||||
|
@ -37,7 +40,7 @@ where
|
|||
pub fn keys_raw_from<'a, K, P>(
|
||||
self: &'a Arc<Self>,
|
||||
from: &P,
|
||||
) -> impl Stream<Item = Result<Key<'_, K>>> + Send
|
||||
) -> impl Stream<Item = Result<Key<'_, K>>> + Send + use<'a, K, P>
|
||||
where
|
||||
P: AsRef<[u8]> + ?Sized + Debug + Sync,
|
||||
K: Deserialize<'a> + Send,
|
||||
|
@ -47,7 +50,10 @@ where
|
|||
|
||||
#[implement(super::Map)]
|
||||
#[tracing::instrument(skip(self, from), fields(%self), level = "trace")]
|
||||
pub fn raw_keys_from<P>(self: &Arc<Self>, from: &P) -> impl Stream<Item = Result<Key<'_>>> + Send
|
||||
pub fn raw_keys_from<P>(
|
||||
self: &Arc<Self>,
|
||||
from: &P,
|
||||
) -> impl Stream<Item = Result<Key<'_>>> + Send + use<'_, P>
|
||||
where
|
||||
P: AsRef<[u8]> + ?Sized + Debug,
|
||||
{
|
||||
|
|
|
@ -1,16 +1,16 @@
|
|||
use std::{convert::AsRef, fmt::Debug, sync::Arc};
|
||||
|
||||
use conduwuit::{implement, Result};
|
||||
use futures::{future, Stream, StreamExt, TryStreamExt};
|
||||
use conduwuit::{Result, implement};
|
||||
use futures::{Stream, StreamExt, TryStreamExt, future};
|
||||
use serde::{Deserialize, Serialize};
|
||||
|
||||
use crate::keyval::{result_deserialize_key, serialize_key, Key};
|
||||
use crate::keyval::{Key, result_deserialize_key, serialize_key};
|
||||
|
||||
#[implement(super::Map)]
|
||||
pub fn keys_prefix<'a, K, P>(
|
||||
self: &'a Arc<Self>,
|
||||
prefix: &P,
|
||||
) -> impl Stream<Item = Result<Key<'_, K>>> + Send
|
||||
) -> impl Stream<Item = Result<Key<'_, K>>> + Send + use<'a, K, P>
|
||||
where
|
||||
P: Serialize + ?Sized + Debug,
|
||||
K: Deserialize<'a> + Send,
|
||||
|
@ -24,7 +24,7 @@ where
|
|||
pub fn keys_prefix_raw<P>(
|
||||
self: &Arc<Self>,
|
||||
prefix: &P,
|
||||
) -> impl Stream<Item = Result<Key<'_>>> + Send
|
||||
) -> impl Stream<Item = Result<Key<'_>>> + Send + use<'_, P>
|
||||
where
|
||||
P: Serialize + ?Sized + Debug,
|
||||
{
|
||||
|
|
|
@ -1,17 +1,20 @@
|
|||
use std::{convert::AsRef, fmt::Debug, io::Write, sync::Arc};
|
||||
|
||||
use conduwuit::{arrayvec::ArrayVec, implement, Result};
|
||||
use conduwuit::{Result, arrayvec::ArrayVec, implement};
|
||||
use futures::Future;
|
||||
use serde::Serialize;
|
||||
|
||||
use crate::{keyval::KeyBuf, ser, Handle};
|
||||
use crate::{Handle, keyval::KeyBuf, ser};
|
||||
|
||||
/// Fetch a value from the database into cache, returning a reference-handle
|
||||
/// asynchronously. The key is serialized into an allocated buffer to perform
|
||||
/// the query.
|
||||
#[implement(super::Map)]
|
||||
#[inline]
|
||||
pub fn qry<K>(self: &Arc<Self>, key: &K) -> impl Future<Output = Result<Handle<'_>>> + Send
|
||||
pub fn qry<K>(
|
||||
self: &Arc<Self>,
|
||||
key: &K,
|
||||
) -> impl Future<Output = Result<Handle<'_>>> + Send + use<'_, K>
|
||||
where
|
||||
K: Serialize + ?Sized + Debug,
|
||||
{
|
||||
|
@ -27,7 +30,7 @@ where
|
|||
pub fn aqry<const MAX: usize, K>(
|
||||
self: &Arc<Self>,
|
||||
key: &K,
|
||||
) -> impl Future<Output = Result<Handle<'_>>> + Send
|
||||
) -> impl Future<Output = Result<Handle<'_>>> + Send + use<'_, MAX, K>
|
||||
where
|
||||
K: Serialize + ?Sized + Debug,
|
||||
{
|
||||
|
@ -43,7 +46,7 @@ pub fn bqry<K, B>(
|
|||
self: &Arc<Self>,
|
||||
key: &K,
|
||||
buf: &mut B,
|
||||
) -> impl Future<Output = Result<Handle<'_>>> + Send
|
||||
) -> impl Future<Output = Result<Handle<'_>>> + Send + use<'_, K, B>
|
||||
where
|
||||
K: Serialize + ?Sized + Debug,
|
||||
B: Write + AsRef<[u8]>,
|
||||
|
|
|
@ -1,17 +1,16 @@
|
|||
use std::{fmt::Debug, sync::Arc};
|
||||
|
||||
use conduwuit::{
|
||||
implement,
|
||||
Result, implement,
|
||||
utils::{
|
||||
stream::{automatic_amplification, automatic_width, WidebandExt},
|
||||
IterStream,
|
||||
stream::{WidebandExt, automatic_amplification, automatic_width},
|
||||
},
|
||||
Result,
|
||||
};
|
||||
use futures::{Stream, StreamExt, TryStreamExt};
|
||||
use serde::Serialize;
|
||||
|
||||
use crate::{keyval::KeyBuf, ser, Handle};
|
||||
use crate::{Handle, keyval::KeyBuf, ser};
|
||||
|
||||
pub trait Qry<'a, K, S>
|
||||
where
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
use std::sync::Arc;
|
||||
|
||||
use conduwuit::{implement, Result};
|
||||
use conduwuit::{Result, implement};
|
||||
use futures::{FutureExt, Stream, StreamExt, TryFutureExt, TryStreamExt};
|
||||
use rocksdb::Direction;
|
||||
use serde::Deserialize;
|
||||
|
|
|
@ -1,13 +1,13 @@
|
|||
use std::{convert::AsRef, fmt::Debug, sync::Arc};
|
||||
|
||||
use conduwuit::{implement, Result};
|
||||
use conduwuit::{Result, implement};
|
||||
use futures::{FutureExt, Stream, StreamExt, TryFutureExt, TryStreamExt};
|
||||
use rocksdb::Direction;
|
||||
use serde::{Deserialize, Serialize};
|
||||
|
||||
use super::rev_stream_from::is_cached;
|
||||
use crate::{
|
||||
keyval::{result_deserialize_key, serialize_key, Key},
|
||||
keyval::{Key, result_deserialize_key, serialize_key},
|
||||
stream,
|
||||
};
|
||||
|
||||
|
@ -15,7 +15,7 @@ use crate::{
|
|||
pub fn rev_keys_from<'a, K, P>(
|
||||
self: &'a Arc<Self>,
|
||||
from: &P,
|
||||
) -> impl Stream<Item = Result<Key<'_, K>>> + Send
|
||||
) -> impl Stream<Item = Result<Key<'_, K>>> + Send + use<'a, K, P>
|
||||
where
|
||||
P: Serialize + ?Sized + Debug,
|
||||
K: Deserialize<'a> + Send,
|
||||
|
@ -29,7 +29,7 @@ where
|
|||
pub fn rev_keys_from_raw<P>(
|
||||
self: &Arc<Self>,
|
||||
from: &P,
|
||||
) -> impl Stream<Item = Result<Key<'_>>> + Send
|
||||
) -> impl Stream<Item = Result<Key<'_>>> + Send + use<'_, P>
|
||||
where
|
||||
P: Serialize + ?Sized + Debug,
|
||||
{
|
||||
|
@ -41,7 +41,7 @@ where
|
|||
pub fn rev_keys_raw_from<'a, K, P>(
|
||||
self: &'a Arc<Self>,
|
||||
from: &P,
|
||||
) -> impl Stream<Item = Result<Key<'_, K>>> + Send
|
||||
) -> impl Stream<Item = Result<Key<'_, K>>> + Send + use<'a, K, P>
|
||||
where
|
||||
P: AsRef<[u8]> + ?Sized + Debug + Sync,
|
||||
K: Deserialize<'a> + Send,
|
||||
|
@ -55,7 +55,7 @@ where
|
|||
pub fn rev_raw_keys_from<P>(
|
||||
self: &Arc<Self>,
|
||||
from: &P,
|
||||
) -> impl Stream<Item = Result<Key<'_>>> + Send
|
||||
) -> impl Stream<Item = Result<Key<'_>>> + Send + use<'_, P>
|
||||
where
|
||||
P: AsRef<[u8]> + ?Sized + Debug,
|
||||
{
|
||||
|
|
|
@ -1,16 +1,16 @@
|
|||
use std::{convert::AsRef, fmt::Debug, sync::Arc};
|
||||
|
||||
use conduwuit::{implement, Result};
|
||||
use futures::{future, Stream, StreamExt, TryStreamExt};
|
||||
use conduwuit::{Result, implement};
|
||||
use futures::{Stream, StreamExt, TryStreamExt, future};
|
||||
use serde::{Deserialize, Serialize};
|
||||
|
||||
use crate::keyval::{result_deserialize_key, serialize_key, Key};
|
||||
use crate::keyval::{Key, result_deserialize_key, serialize_key};
|
||||
|
||||
#[implement(super::Map)]
|
||||
pub fn rev_keys_prefix<'a, K, P>(
|
||||
self: &'a Arc<Self>,
|
||||
prefix: &P,
|
||||
) -> impl Stream<Item = Result<Key<'_, K>>> + Send
|
||||
) -> impl Stream<Item = Result<Key<'_, K>>> + Send + use<'a, K, P>
|
||||
where
|
||||
P: Serialize + ?Sized + Debug,
|
||||
K: Deserialize<'a> + Send,
|
||||
|
@ -24,7 +24,7 @@ where
|
|||
pub fn rev_keys_prefix_raw<P>(
|
||||
self: &Arc<Self>,
|
||||
prefix: &P,
|
||||
) -> impl Stream<Item = Result<Key<'_>>> + Send
|
||||
) -> impl Stream<Item = Result<Key<'_>>> + Send + use<'_, P>
|
||||
where
|
||||
P: Serialize + ?Sized + Debug,
|
||||
{
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
use std::sync::Arc;
|
||||
|
||||
use conduwuit::{implement, Result};
|
||||
use conduwuit::{Result, implement};
|
||||
use futures::{FutureExt, Stream, StreamExt, TryFutureExt, TryStreamExt};
|
||||
use rocksdb::Direction;
|
||||
use serde::Deserialize;
|
||||
|
|
|
@ -1,13 +1,13 @@
|
|||
use std::{convert::AsRef, fmt::Debug, sync::Arc};
|
||||
|
||||
use conduwuit::{implement, Result};
|
||||
use conduwuit::{Result, implement};
|
||||
use futures::{FutureExt, Stream, StreamExt, TryFutureExt, TryStreamExt};
|
||||
use rocksdb::Direction;
|
||||
use serde::{Deserialize, Serialize};
|
||||
use tokio::task;
|
||||
|
||||
use crate::{
|
||||
keyval::{result_deserialize, serialize_key, KeyVal},
|
||||
keyval::{KeyVal, result_deserialize, serialize_key},
|
||||
stream,
|
||||
util::is_incomplete,
|
||||
};
|
||||
|
@ -20,7 +20,7 @@ use crate::{
|
|||
pub fn rev_stream_from<'a, K, V, P>(
|
||||
self: &'a Arc<Self>,
|
||||
from: &P,
|
||||
) -> impl Stream<Item = Result<KeyVal<'_, K, V>>> + Send
|
||||
) -> impl Stream<Item = Result<KeyVal<'_, K, V>>> + Send + use<'a, K, V, P>
|
||||
where
|
||||
P: Serialize + ?Sized + Debug,
|
||||
K: Deserialize<'a> + Send,
|
||||
|
@ -39,7 +39,7 @@ where
|
|||
pub fn rev_stream_from_raw<P>(
|
||||
self: &Arc<Self>,
|
||||
from: &P,
|
||||
) -> impl Stream<Item = Result<KeyVal<'_>>> + Send
|
||||
) -> impl Stream<Item = Result<KeyVal<'_>>> + Send + use<'_, P>
|
||||
where
|
||||
P: Serialize + ?Sized + Debug,
|
||||
{
|
||||
|
@ -55,7 +55,7 @@ where
|
|||
pub fn rev_stream_raw_from<'a, K, V, P>(
|
||||
self: &'a Arc<Self>,
|
||||
from: &P,
|
||||
) -> impl Stream<Item = Result<KeyVal<'_, K, V>>> + Send
|
||||
) -> impl Stream<Item = Result<KeyVal<'_, K, V>>> + Send + use<'a, K, V, P>
|
||||
where
|
||||
P: AsRef<[u8]> + ?Sized + Debug + Sync,
|
||||
K: Deserialize<'a> + Send,
|
||||
|
@ -74,7 +74,7 @@ where
|
|||
pub fn rev_raw_stream_from<P>(
|
||||
self: &Arc<Self>,
|
||||
from: &P,
|
||||
) -> impl Stream<Item = Result<KeyVal<'_>>> + Send
|
||||
) -> impl Stream<Item = Result<KeyVal<'_>>> + Send + use<'_, P>
|
||||
where
|
||||
P: AsRef<[u8]> + ?Sized + Debug,
|
||||
{
|
||||
|
|
|
@ -1,10 +1,10 @@
|
|||
use std::{convert::AsRef, fmt::Debug, sync::Arc};
|
||||
|
||||
use conduwuit::{implement, Result};
|
||||
use futures::{future, Stream, StreamExt, TryStreamExt};
|
||||
use conduwuit::{Result, implement};
|
||||
use futures::{Stream, StreamExt, TryStreamExt, future};
|
||||
use serde::{Deserialize, Serialize};
|
||||
|
||||
use crate::keyval::{result_deserialize, serialize_key, KeyVal};
|
||||
use crate::keyval::{KeyVal, result_deserialize, serialize_key};
|
||||
|
||||
/// Iterate key-value entries in the map where the key matches a prefix.
|
||||
///
|
||||
|
@ -14,7 +14,7 @@ use crate::keyval::{result_deserialize, serialize_key, KeyVal};
|
|||
pub fn rev_stream_prefix<'a, K, V, P>(
|
||||
self: &'a Arc<Self>,
|
||||
prefix: &P,
|
||||
) -> impl Stream<Item = Result<KeyVal<'_, K, V>>> + Send
|
||||
) -> impl Stream<Item = Result<KeyVal<'_, K, V>>> + Send + use<'a, K, V, P>
|
||||
where
|
||||
P: Serialize + ?Sized + Debug,
|
||||
K: Deserialize<'a> + Send,
|
||||
|
@ -33,7 +33,7 @@ where
|
|||
pub fn rev_stream_prefix_raw<P>(
|
||||
self: &Arc<Self>,
|
||||
prefix: &P,
|
||||
) -> impl Stream<Item = Result<KeyVal<'_>>> + Send
|
||||
) -> impl Stream<Item = Result<KeyVal<'_>>> + Send + use<'_, P>
|
||||
where
|
||||
P: Serialize + ?Sized + Debug,
|
||||
{
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
use std::sync::Arc;
|
||||
|
||||
use conduwuit::{implement, Result};
|
||||
use conduwuit::{Result, implement};
|
||||
use futures::{FutureExt, Stream, StreamExt, TryFutureExt, TryStreamExt};
|
||||
use rocksdb::Direction;
|
||||
use serde::Deserialize;
|
||||
|
|
|
@ -1,13 +1,13 @@
|
|||
use std::{convert::AsRef, fmt::Debug, sync::Arc};
|
||||
|
||||
use conduwuit::{implement, Result};
|
||||
use conduwuit::{Result, implement};
|
||||
use futures::{FutureExt, Stream, StreamExt, TryFutureExt, TryStreamExt};
|
||||
use rocksdb::Direction;
|
||||
use serde::{Deserialize, Serialize};
|
||||
use tokio::task;
|
||||
|
||||
use crate::{
|
||||
keyval::{result_deserialize, serialize_key, KeyVal},
|
||||
keyval::{KeyVal, result_deserialize, serialize_key},
|
||||
stream,
|
||||
};
|
||||
|
||||
|
@ -19,7 +19,7 @@ use crate::{
|
|||
pub fn stream_from<'a, K, V, P>(
|
||||
self: &'a Arc<Self>,
|
||||
from: &P,
|
||||
) -> impl Stream<Item = Result<KeyVal<'_, K, V>>> + Send
|
||||
) -> impl Stream<Item = Result<KeyVal<'_, K, V>>> + Send + use<'a, K, V, P>
|
||||
where
|
||||
P: Serialize + ?Sized + Debug,
|
||||
K: Deserialize<'a> + Send,
|
||||
|
@ -37,7 +37,7 @@ where
|
|||
pub fn stream_from_raw<P>(
|
||||
self: &Arc<Self>,
|
||||
from: &P,
|
||||
) -> impl Stream<Item = Result<KeyVal<'_>>> + Send
|
||||
) -> impl Stream<Item = Result<KeyVal<'_>>> + Send + use<'_, P>
|
||||
where
|
||||
P: Serialize + ?Sized + Debug,
|
||||
{
|
||||
|
@ -53,7 +53,7 @@ where
|
|||
pub fn stream_raw_from<'a, K, V, P>(
|
||||
self: &'a Arc<Self>,
|
||||
from: &P,
|
||||
) -> impl Stream<Item = Result<KeyVal<'_, K, V>>> + Send
|
||||
) -> impl Stream<Item = Result<KeyVal<'_, K, V>>> + Send + use<'a, K, V, P>
|
||||
where
|
||||
P: AsRef<[u8]> + ?Sized + Debug + Sync,
|
||||
K: Deserialize<'a> + Send,
|
||||
|
@ -71,7 +71,7 @@ where
|
|||
pub fn raw_stream_from<P>(
|
||||
self: &Arc<Self>,
|
||||
from: &P,
|
||||
) -> impl Stream<Item = Result<KeyVal<'_>>> + Send
|
||||
) -> impl Stream<Item = Result<KeyVal<'_>>> + Send + use<'_, P>
|
||||
where
|
||||
P: AsRef<[u8]> + ?Sized + Debug,
|
||||
{
|
||||
|
|
|
@ -1,10 +1,10 @@
|
|||
use std::{convert::AsRef, fmt::Debug, sync::Arc};
|
||||
|
||||
use conduwuit::{implement, Result};
|
||||
use futures::{future, Stream, StreamExt, TryStreamExt};
|
||||
use conduwuit::{Result, implement};
|
||||
use futures::{Stream, StreamExt, TryStreamExt, future};
|
||||
use serde::{Deserialize, Serialize};
|
||||
|
||||
use crate::keyval::{result_deserialize, serialize_key, KeyVal};
|
||||
use crate::keyval::{KeyVal, result_deserialize, serialize_key};
|
||||
|
||||
/// Iterate key-value entries in the map where the key matches a prefix.
|
||||
///
|
||||
|
@ -14,7 +14,7 @@ use crate::keyval::{result_deserialize, serialize_key, KeyVal};
|
|||
pub fn stream_prefix<'a, K, V, P>(
|
||||
self: &'a Arc<Self>,
|
||||
prefix: &P,
|
||||
) -> impl Stream<Item = Result<KeyVal<'_, K, V>>> + Send
|
||||
) -> impl Stream<Item = Result<KeyVal<'_, K, V>>> + Send + use<'a, K, V, P>
|
||||
where
|
||||
P: Serialize + ?Sized + Debug,
|
||||
K: Deserialize<'a> + Send,
|
||||
|
@ -33,7 +33,7 @@ where
|
|||
pub fn stream_prefix_raw<P>(
|
||||
self: &Arc<Self>,
|
||||
prefix: &P,
|
||||
) -> impl Stream<Item = Result<KeyVal<'_>>> + Send
|
||||
) -> impl Stream<Item = Result<KeyVal<'_>>> + Send + use<'_, P>
|
||||
where
|
||||
P: Serialize + ?Sized + Debug,
|
||||
{
|
||||
|
|
|
@ -3,8 +3,8 @@ use std::{collections::BTreeMap, sync::Arc};
|
|||
use conduwuit::Result;
|
||||
|
||||
use crate::{
|
||||
engine::descriptor::{self, CacheDisp, Descriptor},
|
||||
Engine, Map,
|
||||
engine::descriptor::{self, CacheDisp, Descriptor},
|
||||
};
|
||||
|
||||
pub(super) type Maps = BTreeMap<MapsKey, MapsVal>;
|
||||
|
|
|
@ -23,18 +23,18 @@ mod watchers;
|
|||
|
||||
use std::{ops::Index, sync::Arc};
|
||||
|
||||
use conduwuit::{err, Result, Server};
|
||||
use conduwuit::{Result, Server, err};
|
||||
|
||||
pub use self::{
|
||||
de::{Ignore, IgnoreAll},
|
||||
deserialized::Deserialized,
|
||||
handle::Handle,
|
||||
keyval::{serialize_key, serialize_val, KeyVal, Slice},
|
||||
map::{compact, Get, Map, Qry},
|
||||
ser::{serialize, serialize_to, serialize_to_vec, Cbor, Interfix, Json, Separator, SEP},
|
||||
keyval::{KeyVal, Slice, serialize_key, serialize_val},
|
||||
map::{Get, Map, Qry, compact},
|
||||
ser::{Cbor, Interfix, Json, SEP, Separator, serialize, serialize_to, serialize_to_vec},
|
||||
};
|
||||
pub(crate) use self::{
|
||||
engine::{context::Context, Engine},
|
||||
engine::{Engine, context::Context},
|
||||
util::or_else,
|
||||
};
|
||||
use crate::maps::{Maps, MapsKey, MapsVal};
|
||||
|
|
|
@ -3,8 +3,8 @@ mod configure;
|
|||
use std::{
|
||||
mem::take,
|
||||
sync::{
|
||||
atomic::{AtomicUsize, Ordering},
|
||||
Arc, Mutex,
|
||||
atomic::{AtomicUsize, Ordering},
|
||||
},
|
||||
thread,
|
||||
thread::JoinHandle,
|
||||
|
@ -12,19 +12,18 @@ use std::{
|
|||
|
||||
use async_channel::{QueueStrategy, Receiver, RecvError, Sender};
|
||||
use conduwuit::{
|
||||
debug, debug_warn, err, error, implement,
|
||||
Error, Result, Server, debug, debug_warn, err, error, implement,
|
||||
result::DebugInspect,
|
||||
smallvec::SmallVec,
|
||||
trace,
|
||||
utils::sys::compute::{get_affinity, nth_core_available, set_affinity},
|
||||
Error, Result, Server,
|
||||
};
|
||||
use futures::{channel::oneshot, TryFutureExt};
|
||||
use futures::{TryFutureExt, channel::oneshot};
|
||||
use oneshot::Sender as ResultSender;
|
||||
use rocksdb::Direction;
|
||||
|
||||
use self::configure::configure;
|
||||
use crate::{keyval::KeyBuf, stream, Handle, Map};
|
||||
use crate::{Handle, Map, keyval::KeyBuf, stream};
|
||||
|
||||
/// Frontend thread-pool. Operating system threads are used to make database
|
||||
/// requests which are not cached. These thread-blocking requests are offloaded
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
use std::{path::PathBuf, sync::Arc};
|
||||
|
||||
use conduwuit::{
|
||||
debug, debug_info, expected, is_equal_to,
|
||||
Server, debug, debug_info, expected, is_equal_to,
|
||||
utils::{
|
||||
math::usize_from_f64,
|
||||
result::LogDebugErr,
|
||||
|
@ -9,7 +9,6 @@ use conduwuit::{
|
|||
stream::{AMPLIFICATION_LIMIT, WIDTH_LIMIT},
|
||||
sys::{compute::is_core_available, storage},
|
||||
},
|
||||
Server,
|
||||
};
|
||||
|
||||
use super::{QUEUE_LIMIT, WORKER_LIMIT};
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
use std::io::Write;
|
||||
|
||||
use conduwuit::{debug::type_name, err, result::DebugInspect, utils::exchange, Error, Result};
|
||||
use serde::{ser, Deserialize, Serialize};
|
||||
use conduwuit::{Error, Result, debug::type_name, err, result::DebugInspect, utils::exchange};
|
||||
use serde::{Deserialize, Serialize, ser};
|
||||
|
||||
use crate::util::unhandled;
|
||||
|
||||
|
|
|
@ -5,15 +5,15 @@ mod keys_rev;
|
|||
|
||||
use std::sync::Arc;
|
||||
|
||||
use conduwuit::{utils::exchange, Result};
|
||||
use conduwuit::{Result, utils::exchange};
|
||||
use rocksdb::{DBRawIteratorWithThreadMode, ReadOptions};
|
||||
|
||||
pub(crate) use self::{items::Items, items_rev::ItemsRev, keys::Keys, keys_rev::KeysRev};
|
||||
use crate::{
|
||||
Map, Slice,
|
||||
engine::Db,
|
||||
keyval::{Key, KeyVal, Val},
|
||||
util::{is_incomplete, map_err},
|
||||
Map, Slice,
|
||||
};
|
||||
|
||||
pub(crate) struct State<'a> {
|
||||
|
|
|
@ -2,12 +2,12 @@ use std::pin::Pin;
|
|||
|
||||
use conduwuit::Result;
|
||||
use futures::{
|
||||
Stream,
|
||||
stream::FusedStream,
|
||||
task::{Context, Poll},
|
||||
Stream,
|
||||
};
|
||||
|
||||
use super::{keyval_longevity, Cursor, State};
|
||||
use super::{Cursor, State, keyval_longevity};
|
||||
use crate::keyval::KeyVal;
|
||||
|
||||
pub(crate) struct Items<'a> {
|
||||
|
|
|
@ -2,12 +2,12 @@ use std::pin::Pin;
|
|||
|
||||
use conduwuit::Result;
|
||||
use futures::{
|
||||
Stream,
|
||||
stream::FusedStream,
|
||||
task::{Context, Poll},
|
||||
Stream,
|
||||
};
|
||||
|
||||
use super::{keyval_longevity, Cursor, State};
|
||||
use super::{Cursor, State, keyval_longevity};
|
||||
use crate::keyval::KeyVal;
|
||||
|
||||
pub(crate) struct ItemsRev<'a> {
|
||||
|
|
|
@ -2,12 +2,12 @@ use std::pin::Pin;
|
|||
|
||||
use conduwuit::Result;
|
||||
use futures::{
|
||||
Stream,
|
||||
stream::FusedStream,
|
||||
task::{Context, Poll},
|
||||
Stream,
|
||||
};
|
||||
|
||||
use super::{slice_longevity, Cursor, State};
|
||||
use super::{Cursor, State, slice_longevity};
|
||||
use crate::keyval::Key;
|
||||
|
||||
pub(crate) struct Keys<'a> {
|
||||
|
|
|
@ -2,12 +2,12 @@ use std::pin::Pin;
|
|||
|
||||
use conduwuit::Result;
|
||||
use futures::{
|
||||
Stream,
|
||||
stream::FusedStream,
|
||||
task::{Context, Poll},
|
||||
Stream,
|
||||
};
|
||||
|
||||
use super::{slice_longevity, Cursor, State};
|
||||
use super::{Cursor, State, slice_longevity};
|
||||
use crate::keyval::Key;
|
||||
|
||||
pub(crate) struct KeysRev<'a> {
|
||||
|
|
|
@ -4,14 +4,13 @@ use std::fmt::Debug;
|
|||
|
||||
use conduwuit::{
|
||||
arrayvec::ArrayVec,
|
||||
ruma::{serde::Raw, EventId, RoomId, UserId},
|
||||
ruma::{EventId, RoomId, UserId, serde::Raw},
|
||||
};
|
||||
use serde::Serialize;
|
||||
|
||||
use crate::{
|
||||
de, ser,
|
||||
ser::{serialize_to_vec, Json},
|
||||
Ignore, Interfix,
|
||||
Ignore, Interfix, de, ser,
|
||||
ser::{Json, serialize_to_vec},
|
||||
};
|
||||
|
||||
#[test]
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
use std::{
|
||||
collections::{hash_map, HashMap},
|
||||
collections::{HashMap, hash_map},
|
||||
future::Future,
|
||||
pin::Pin,
|
||||
sync::RwLock,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue