Skip to main content

Map

Struct Map 

Source
pub struct Map {
    name: &'static str,
    watch: Watch,
    cf: Arc<ColumnFamily>,
    engine: Arc<Engine>,
    read_options: ReadOptions,
    cache_read_options: ReadOptions,
    write_options: WriteOptions,
}

Fields§

§name: &'static str§watch: Watch§cf: Arc<ColumnFamily>§engine: Arc<Engine>§read_options: ReadOptions§cache_read_options: ReadOptions§write_options: WriteOptions

Implementations§

Source§

impl Map

Source

pub async fn clear(self: &Arc<Self>)

Delete all data stored in this map. !!! USE WITH CAUTION !!!

See for_clear() with additional details.

Source§

impl Map

Source

pub fn for_clear(self: &Arc<Self>) -> impl Stream<Item = Result<Key<'_>>> + Send

Delete all data stored in this map. !!! USE WITH CAUTION !!!

Provides stream of keys undergoing deletion along with any errors.

Note this operation applies to a snapshot of the data when invoked. Additional data written during or after this call may be missed.

Source§

impl Map

Source

pub fn compact_blocking(&self, opts: Options) -> Result

Source§

impl Map

Source

pub fn contains<K>( self: &Arc<Self>, key: &K, ) -> impl Future<Output = bool> + Send + '_ + use<'_, K>
where K: Serialize + ?Sized + Debug,

Returns true if the map contains the key.

  • key is serialized into allocated buffer
  • harder errors may not be reported
Source§

impl Map

Source

pub fn acontains<const MAX: usize, K>( self: &Arc<Self>, key: &K, ) -> impl Future<Output = bool> + Send + '_ + use<'_, MAX, K>
where K: Serialize + ?Sized + Debug,

Returns true if the map contains the key.

  • key is serialized into stack-buffer
  • harder errors will panic
Source§

impl Map

Source

pub fn bcontains<K, B>( self: &Arc<Self>, key: &K, buf: &mut B, ) -> impl Future<Output = bool> + Send + '_ + use<'_, K, B>
where K: Serialize + ?Sized + Debug, B: Write + AsRef<[u8]>,

Returns true if the map contains the key.

  • key is serialized into provided buffer
  • harder errors will panic
Source§

impl Map

Source

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,

Returns Ok if the map contains the key.

  • key is raw
Source§

impl Map

Source

pub fn exists_blocking<K>(&self, key: &K) -> Result
where K: AsRef<[u8]> + ?Sized + Debug,

Returns Ok if the map contains the key; NotFound otherwise. Harder errors may not always be reported properly.

Source§

impl Map

Source

pub(crate) fn maybe_exists<K>(&self, key: &K) -> bool
where K: AsRef<[u8]> + ?Sized,

Rocksdb limits this to kBlockCacheTier internally so this is not actually a blocking call; in case that changes we set this as well in our read_options.

Source§

impl Map

Source

pub fn count(self: &Arc<Self>) -> impl Future<Output = usize> + Send + '_

Count the total number of entries in the map.

Source§

impl Map

Source

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,

Count the number of entries in the map starting from a lower-bound.

  • From is a structured key
Source§

impl Map

Source

pub fn raw_count_from<'a, P>( self: &'a Arc<Self>, from: &'a P, ) -> impl Future<Output = usize> + Send + 'a
where P: AsRef<[u8]> + ?Sized + Debug + Sync + 'a,

Count the number of entries in the map starting from a lower-bound.

  • From is a raw
Source§

impl Map

Source

pub fn count_prefix<'a, P>( self: &'a Arc<Self>, prefix: &P, ) -> impl Future<Output = usize> + Send + 'a + use<'a, P>
where P: Serialize + ?Sized + Debug + 'a,

Count the number of entries in the map matching a prefix.

  • Prefix is structured key
Source§

impl Map

Source

pub fn raw_count_prefix<'a, P>( self: &'a Arc<Self>, prefix: &'a P, ) -> impl Future<Output = usize> + Send + 'a
where P: AsRef<[u8]> + ?Sized + Debug + Sync + 'a,

Count the number of entries in the map matching a prefix.

  • Prefix is raw
Source§

impl Map

Source

pub fn del<K>(&self, key: K)
where K: Serialize + Debug,

Source§

impl Map

Source

pub fn adel<const MAX: usize, K>(&self, key: K)
where K: Serialize + Debug,

Source§

impl Map

Source

pub fn bdel<K, B>(&self, key: K, buf: &mut B)
where K: Serialize + Debug, B: Write + AsRef<[u8]>,

Source§

impl Map

Source

pub fn get<K>( self: &Arc<Self>, key: &K, ) -> impl Future<Output = Result<Handle<'_>>> + Send + use<'_, K>
where K: AsRef<[u8]> + Debug + ?Sized,

Fetch a value from the database into cache, returning a reference-handle asynchronously. The key is referenced directly to perform the query.

Source§

impl Map

Source

pub(crate) fn get_cached<K>(&self, key: &K) -> Result<Option<Handle<'_>>>
where K: AsRef<[u8]> + Debug + ?Sized,

Fetch a value from the cache without I/O.

Source§

impl Map

Source

pub fn get_blocking<K>(&self, key: &K) -> Result<Handle<'_>>
where K: AsRef<[u8]> + ?Sized,

Fetch a value from the database into cache, returning a reference-handle. The key is referenced directly to perform the query. This is a thread- blocking call.

Source§

impl Map

Source

fn get_blocking_opts<K>( &self, key: &K, read_options: &ReadOptions, ) -> Result<Option<DBPinnableSlice<'_>>, Error>
where K: AsRef<[u8]> + ?Sized,

Source§

impl Map

Source

pub(crate) fn get_batch<'a, S, K>( self: &'a Arc<Self>, keys: S, ) -> impl Stream<Item = Result<Handle<'_>>> + Send + 'a
where S: Stream<Item = K> + Send + 'a, K: AsRef<[u8]> + Send + Sync + 'a,

Source§

impl Map

Source

pub(crate) fn _get_batch_cached<'a, I, K>( &self, keys: I, ) -> 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,

Source§

impl Map

Source

pub(crate) fn get_batch_blocking<'a, I, K>( &self, keys: I, ) -> impl Iterator<Item = Result<Handle<'_>>> + Send + use<'_, I, K>
where I: Iterator<Item = &'a K> + ExactSizeIterator + Send, K: AsRef<[u8]> + Send + ?Sized + Sync + 'a,

Source§

impl Map

Source

fn get_batch_blocking_opts<'a, I, K>( &self, keys: I, read_options: &ReadOptions, ) -> impl Iterator<Item = Result<Option<DBPinnableSlice<'_>>, Error>> + Send + use<'_, I, K>
where I: Iterator<Item = &'a K> + ExactSizeIterator + Send, K: AsRef<[u8]> + Send + ?Sized + Sync + 'a,

Source§

impl Map

Source

pub fn insert<K, V>(&self, key: &K, val: V)
where K: AsRef<[u8]> + ?Sized, V: AsRef<[u8]>,

Insert Key/Value

  • Key is raw
  • Val is raw
Source§

impl Map

Source

pub fn insert_batch<'a, I, K, V>(&'a self, iter: I)
where I: Iterator<Item = (K, V)> + Send + Debug, K: AsRef<[u8]> + Sized + Debug + 'a, V: AsRef<[u8]> + Sized + 'a,

Source§

impl Map

Source

pub fn keys<'a, K>( self: &'a Arc<Self>, ) -> impl Stream<Item = Result<Key<'_, K>>> + Send
where K: Deserialize<'a> + Send,

Source§

impl Map

Source

pub fn raw_keys(self: &Arc<Self>) -> impl Stream<Item = Result<Key<'_>>> + Send

Source§

impl Map

Source

pub fn keys_from<'a, K, P>( self: &'a Arc<Self>, from: &P, ) -> impl Stream<Item = Result<Key<'_, K>>> + Send + use<'a, K, P>
where P: Serialize + ?Sized + Debug, K: Deserialize<'a> + Send,

Source§

impl Map

Source

pub fn keys_from_raw<P>( self: &Arc<Self>, from: &P, ) -> impl Stream<Item = Result<Key<'_>>> + Send + use<'_, P>
where P: Serialize + ?Sized + Debug,

Source§

impl Map

Source

pub fn keys_raw_from<'a, K, P>( self: &'a Arc<Self>, from: &P, ) -> impl Stream<Item = Result<Key<'_, K>>> + Send + use<'a, K, P>
where P: AsRef<[u8]> + ?Sized + Debug + Sync, K: Deserialize<'a> + Send,

Source§

impl Map

Source

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,

Source§

impl Map

Source

pub fn keys_prefix<'a, K, P>( self: &'a Arc<Self>, prefix: &P, ) -> impl Stream<Item = Result<Key<'_, K>>> + Send + use<'a, K, P>
where P: Serialize + ?Sized + Debug, K: Deserialize<'a> + Send,

Source§

impl Map

Source

pub fn keys_prefix_raw<P>( self: &Arc<Self>, prefix: &P, ) -> impl Stream<Item = Result<Key<'_>>> + Send + use<'_, P>
where P: Serialize + ?Sized + Debug,

Source§

impl Map

Source

pub fn keys_raw_prefix<'a, K, P>( self: &'a Arc<Self>, prefix: &'a P, ) -> impl Stream<Item = Result<Key<'_, K>>> + Send + 'a
where P: AsRef<[u8]> + ?Sized + Debug + Sync + 'a, K: Deserialize<'a> + Send + 'a,

Source§

impl Map

Source

pub fn raw_keys_prefix<'a, P>( self: &'a Arc<Self>, prefix: &'a P, ) -> impl Stream<Item = Result<Key<'_>>> + Send + 'a
where P: AsRef<[u8]> + ?Sized + Debug + Sync + 'a,

Source§

impl Map

Source

pub fn put<K, V>(&self, key: K, val: V)
where K: Serialize + Debug, V: Serialize,

Insert Key/Value

  • Key is serialized
  • Val is serialized
Source§

impl Map

Source

pub fn put_raw<K, V>(&self, key: K, val: V)
where K: Serialize + Debug, V: AsRef<[u8]>,

Insert Key/Value

  • Key is serialized
  • Val is raw
Source§

impl Map

Source

pub fn raw_put<K, V>(&self, key: K, val: V)
where K: AsRef<[u8]>, V: Serialize,

Insert Key/Value

  • Key is raw
  • Val is serialized
Source§

impl Map

Source

pub fn put_aput<const VMAX: usize, K, V>(&self, key: K, val: V)
where K: Serialize + Debug, V: Serialize,

Insert Key/Value

  • Key is serialized
  • Val is serialized to stack-buffer
Source§

impl Map

Source

pub fn aput_put<const KMAX: usize, K, V>(&self, key: K, val: V)
where K: Serialize + Debug, V: Serialize,

Insert Key/Value

  • Key is serialized to stack-buffer
  • Val is serialized
Source§

impl Map

Source

pub fn aput<const KMAX: usize, const VMAX: usize, K, V>(&self, key: K, val: V)
where K: Serialize + Debug, V: Serialize,

Insert Key/Value

  • Key is serialized to stack-buffer
  • Val is serialized to stack-buffer
Source§

impl Map

Source

pub fn aput_raw<const KMAX: usize, K, V>(&self, key: K, val: V)
where K: Serialize + Debug, V: AsRef<[u8]>,

Insert Key/Value

  • Key is serialized to stack-buffer
  • Val is raw
Source§

impl Map

Source

pub fn raw_aput<const VMAX: usize, K, V>(&self, key: K, val: V)
where K: AsRef<[u8]>, V: Serialize,

Insert Key/Value

  • Key is raw
  • Val is serialized to stack-buffer
Source§

impl Map

Source

pub fn bput<K, V, Bk, Bv>(&self, key: K, val: V, buf: (Bk, Bv))
where K: Serialize + Debug, V: Serialize, Bk: Write + AsRef<[u8]>, Bv: Write + AsRef<[u8]>,

Insert Key/Value

  • Key is serialized to supplied buffer
  • Val is serialized to supplied buffer
Source§

impl Map

Source

pub fn bput_raw<K, V, Bk>(&self, key: K, val: V, buf: Bk)
where K: Serialize + Debug, V: AsRef<[u8]>, Bk: Write + AsRef<[u8]>,

Insert Key/Value

  • Key is serialized to supplied buffer
  • Val is raw
Source§

impl Map

Source

pub fn raw_bput<K, V, Bv>(&self, key: K, val: V, buf: Bv)
where K: AsRef<[u8]>, V: Serialize, Bv: Write + AsRef<[u8]>,

Insert Key/Value

  • Key is raw
  • Val is serialized to supplied buffer
Source§

impl Map

Source

pub fn qry<K>( self: &Arc<Self>, key: &K, ) -> impl Future<Output = Result<Handle<'_>>> + Send + use<'_, K>
where K: Serialize + ?Sized + Debug,

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.

Source§

impl Map

Source

pub fn aqry<const MAX: usize, K>( self: &Arc<Self>, key: &K, ) -> impl Future<Output = Result<Handle<'_>>> + Send + use<'_, MAX, K>
where K: Serialize + ?Sized + Debug,

Fetch a value from the database into cache, returning a reference-handle asynchronously. The key is serialized into a fixed-sized buffer to perform the query. The maximum size is supplied as const generic parameter.

Source§

impl Map

Source

pub fn bqry<K, B>( self: &Arc<Self>, key: &K, buf: &mut B, ) -> impl Future<Output = Result<Handle<'_>>> + Send + use<'_, K, B>
where K: Serialize + ?Sized + Debug, B: Write + AsRef<[u8]>,

Fetch a value from the database into cache, returning a reference-handle asynchronously. The key is serialized into a user-supplied Writer.

Source§

impl Map

Source

pub(crate) fn qry_batch<'a, S, K>( self: &'a Arc<Self>, keys: S, ) -> impl Stream<Item = Result<Handle<'_>>> + Send + 'a
where S: Stream<Item = K> + Send + 'a, K: Serialize + Debug + 'a,

Source§

impl Map

Source

pub fn remove<K>(&self, key: &K)
where K: AsRef<[u8]> + ?Sized + Debug,

Source§

impl Map

Source

pub fn rev_keys<'a, K>( self: &'a Arc<Self>, ) -> impl Stream<Item = Result<Key<'_, K>>> + Send
where K: Deserialize<'a> + Send,

Source§

impl Map

Source

pub fn rev_raw_keys( self: &Arc<Self>, ) -> impl Stream<Item = Result<Key<'_>>> + Send

Source§

impl Map

Source

pub fn rev_keys_from<'a, K, P>( self: &'a Arc<Self>, from: &P, ) -> impl Stream<Item = Result<Key<'_, K>>> + Send + use<'a, K, P>
where P: Serialize + ?Sized + Debug, K: Deserialize<'a> + Send,

Source§

impl Map

Source

pub fn rev_keys_from_raw<P>( self: &Arc<Self>, from: &P, ) -> impl Stream<Item = Result<Key<'_>>> + Send + use<'_, P>
where P: Serialize + ?Sized + Debug,

Source§

impl Map

Source

pub fn rev_keys_raw_from<'a, K, P>( self: &'a Arc<Self>, from: &P, ) -> impl Stream<Item = Result<Key<'_, K>>> + Send + use<'a, K, P>
where P: AsRef<[u8]> + ?Sized + Debug + Sync, K: Deserialize<'a> + Send,

Source§

impl Map

Source

pub fn rev_raw_keys_from<P>( self: &Arc<Self>, from: &P, ) -> impl Stream<Item = Result<Key<'_>>> + Send + use<'_, P>
where P: AsRef<[u8]> + ?Sized + Debug,

Source§

impl Map

Source

pub fn rev_keys_prefix<'a, K, P>( self: &'a Arc<Self>, prefix: &P, ) -> impl Stream<Item = Result<Key<'_, K>>> + Send + use<'a, K, P>
where P: Serialize + ?Sized + Debug, K: Deserialize<'a> + Send,

Source§

impl Map

Source

pub fn rev_keys_prefix_raw<P>( self: &Arc<Self>, prefix: &P, ) -> impl Stream<Item = Result<Key<'_>>> + Send + use<'_, P>
where P: Serialize + ?Sized + Debug,

Source§

impl Map

Source

pub fn rev_keys_raw_prefix<'a, K, P>( self: &'a Arc<Self>, prefix: &'a P, ) -> impl Stream<Item = Result<Key<'_, K>>> + Send + 'a
where P: AsRef<[u8]> + ?Sized + Debug + Sync + 'a, K: Deserialize<'a> + Send + 'a,

Source§

impl Map

Source

pub fn rev_raw_keys_prefix<'a, P>( self: &'a Arc<Self>, prefix: &'a P, ) -> impl Stream<Item = Result<Key<'_>>> + Send + 'a
where P: AsRef<[u8]> + ?Sized + Debug + Sync + 'a,

Source§

impl Map

Source

pub fn rev_stream<'a, K, V>( self: &'a Arc<Self>, ) -> impl Stream<Item = Result<KeyVal<'_, K, V>>> + Send
where K: Deserialize<'a> + Send, V: Deserialize<'a> + Send,

Iterate key-value entries in the map from the end.

  • Result is deserialized
Source§

impl Map

Source

pub fn rev_raw_stream( self: &Arc<Self>, ) -> impl Stream<Item = Result<KeyVal<'_>>> + Send

Iterate key-value entries in the map from the end.

  • Result is raw
Source§

impl Map

Source

pub fn rev_stream_from<'a, K, V, P>( self: &'a Arc<Self>, from: &P, ) -> impl Stream<Item = Result<KeyVal<'_, K, V>>> + Send + use<'a, K, V, P>
where P: Serialize + ?Sized + Debug, K: Deserialize<'a> + Send, V: Deserialize<'a> + Send,

Iterate key-value entries in the map starting from upper-bound.

  • Query is serialized
  • Result is deserialized
Source§

impl Map

Source

pub fn rev_stream_from_raw<P>( self: &Arc<Self>, from: &P, ) -> impl Stream<Item = Result<KeyVal<'_>>> + Send + use<'_, P>
where P: Serialize + ?Sized + Debug,

Iterate key-value entries in the map starting from upper-bound.

  • Query is serialized
  • Result is raw
Source§

impl Map

Source

pub fn rev_stream_raw_from<'a, K, V, P>( self: &'a Arc<Self>, from: &P, ) -> impl Stream<Item = Result<KeyVal<'_, K, V>>> + Send + use<'a, K, V, P>
where P: AsRef<[u8]> + ?Sized + Debug + Sync, K: Deserialize<'a> + Send, V: Deserialize<'a> + Send,

Iterate key-value entries in the map starting from upper-bound.

  • Query is raw
  • Result is deserialized
Source§

impl Map

Source

pub fn rev_raw_stream_from<P>( self: &Arc<Self>, from: &P, ) -> impl Stream<Item = Result<KeyVal<'_>>> + Send + use<'_, P>
where P: AsRef<[u8]> + ?Sized + Debug,

Iterate key-value entries in the map starting from upper-bound.

  • Query is raw
  • Result is raw
Source§

impl Map

Source

pub fn rev_stream_prefix<'a, K, V, P>( self: &'a Arc<Self>, prefix: &P, ) -> impl Stream<Item = Result<KeyVal<'_, K, V>>> + Send + use<'a, K, V, P>
where P: Serialize + ?Sized + Debug, K: Deserialize<'a> + Send, V: Deserialize<'a> + Send,

Iterate key-value entries in the map where the key matches a prefix.

  • Query is serialized
  • Result is deserialized
Source§

impl Map

Source

pub fn rev_stream_prefix_raw<P>( self: &Arc<Self>, prefix: &P, ) -> impl Stream<Item = Result<KeyVal<'_>>> + Send + use<'_, P>
where P: Serialize + ?Sized + Debug,

Iterate key-value entries in the map where the key matches a prefix.

  • Query is serialized
  • Result is raw
Source§

impl Map

Source

pub fn rev_stream_raw_prefix<'a, K, V, P>( self: &'a Arc<Self>, prefix: &'a P, ) -> impl Stream<Item = Result<KeyVal<'_, K, V>>> + Send + 'a
where P: AsRef<[u8]> + ?Sized + Debug + Sync + 'a, K: Deserialize<'a> + Send + 'a, V: Deserialize<'a> + Send + 'a,

Iterate key-value entries in the map where the key matches a prefix.

  • Query is raw
  • Result is deserialized
Source§

impl Map

Source

pub fn rev_raw_stream_prefix<'a, P>( self: &'a Arc<Self>, prefix: &'a P, ) -> impl Stream<Item = Result<KeyVal<'_>>> + Send + 'a
where P: AsRef<[u8]> + ?Sized + Debug + Sync + 'a,

Iterate key-value entries in the map where the key matches a prefix.

  • Query is raw
  • Result is raw
Source§

impl Map

Source

pub fn stream<'a, K, V>( self: &'a Arc<Self>, ) -> impl Stream<Item = Result<KeyVal<'_, K, V>>> + Send
where K: Deserialize<'a> + Send, V: Deserialize<'a> + Send,

Iterate key-value entries in the map from the beginning.

  • Result is deserialized
Source§

impl Map

Source

pub fn raw_stream( self: &Arc<Self>, ) -> impl Stream<Item = Result<KeyVal<'_>>> + Send

Iterate key-value entries in the map from the beginning.

  • Result is raw
Source§

impl Map

Source

pub fn stream_from<'a, K, V, P>( self: &'a Arc<Self>, from: &P, ) -> impl Stream<Item = Result<KeyVal<'_, K, V>>> + Send + use<'a, K, V, P>
where P: Serialize + ?Sized + Debug, K: Deserialize<'a> + Send, V: Deserialize<'a> + Send,

Iterate key-value entries in the map starting from lower-bound.

  • Query is serialized
  • Result is deserialized
Source§

impl Map

Source

pub fn stream_from_raw<P>( self: &Arc<Self>, from: &P, ) -> impl Stream<Item = Result<KeyVal<'_>>> + Send + use<'_, P>
where P: Serialize + ?Sized + Debug,

Iterate key-value entries in the map starting from lower-bound.

  • Query is serialized
  • Result is raw
Source§

impl Map

Source

pub fn stream_raw_from<'a, K, V, P>( self: &'a Arc<Self>, from: &P, ) -> impl Stream<Item = Result<KeyVal<'_, K, V>>> + Send + use<'a, K, V, P>
where P: AsRef<[u8]> + ?Sized + Debug + Sync, K: Deserialize<'a> + Send, V: Deserialize<'a> + Send,

Iterate key-value entries in the map starting from lower-bound.

  • Query is raw
  • Result is deserialized
Source§

impl Map

Source

pub fn raw_stream_from<P>( self: &Arc<Self>, from: &P, ) -> impl Stream<Item = Result<KeyVal<'_>>> + Send + use<'_, P>
where P: AsRef<[u8]> + ?Sized + Debug,

Iterate key-value entries in the map starting from lower-bound.

  • Query is raw
  • Result is raw
Source§

impl Map

Source

pub fn stream_prefix<'a, K, V, P>( self: &'a Arc<Self>, prefix: &P, ) -> impl Stream<Item = Result<KeyVal<'_, K, V>>> + Send + use<'a, K, V, P>
where P: Serialize + ?Sized + Debug, K: Deserialize<'a> + Send, V: Deserialize<'a> + Send,

Iterate key-value entries in the map where the key matches a prefix.

  • Query is serialized
  • Result is deserialized
Source§

impl Map

Source

pub fn stream_prefix_raw<P>( self: &Arc<Self>, prefix: &P, ) -> impl Stream<Item = Result<KeyVal<'_>>> + Send + use<'_, P>
where P: Serialize + ?Sized + Debug,

Iterate key-value entries in the map where the key matches a prefix.

  • Query is serialized
  • Result is raw
Source§

impl Map

Source

pub fn stream_raw_prefix<'a, K, V, P>( self: &'a Arc<Self>, prefix: &'a P, ) -> impl Stream<Item = Result<KeyVal<'_, K, V>>> + Send + 'a
where P: AsRef<[u8]> + ?Sized + Debug + Sync + 'a, K: Deserialize<'a> + Send + 'a, V: Deserialize<'a> + Send + 'a,

Iterate key-value entries in the map where the key matches a prefix.

  • Query is raw
  • Result is deserialized
Source§

impl Map

Source

pub fn raw_stream_prefix<'a, P>( self: &'a Arc<Self>, prefix: &'a P, ) -> impl Stream<Item = Result<KeyVal<'_>>> + Send + 'a
where P: AsRef<[u8]> + ?Sized + Debug + Sync + 'a,

Iterate key-value entries in the map where the key matches a prefix.

  • Query is raw
  • Result is raw
Source§

impl Map

Source

pub fn watch_prefix<K>(&self, prefix: K) -> impl Future<Output = ()> + Send + '_
where K: Serialize,

Source§

impl Map

Source

pub fn watch_raw_prefix<'a, K>( &self, prefix: &'a K, ) -> impl Future<Output = ()> + Send + use<K>
where K: AsRef<[u8]> + ?Sized + 'a,

Source§

impl Map

Source

pub(crate) fn notify<K>(&self, key: &K)
where K: AsRef<[u8]> + Ord + ?Sized,

Source§

impl Map

Source

pub(crate) fn open( engine: &Arc<Engine>, name: &'static str, ) -> Result<Arc<Self>>

Source

pub fn property_integer(&self, name: &CStr) -> Result<u64>

Source

pub fn property(&self, name: &str) -> Result<String>

Source

pub fn name(&self) -> &str

Source

pub(crate) fn engine(&self) -> &Arc<Engine>

Source

pub(crate) fn cf(&self) -> impl AsColumnFamilyRef + '_

Trait Implementations§

Source§

impl Debug for Map

Source§

fn fmt(&self, out: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Display for Map

Source§

fn fmt(&self, out: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

§

impl !Freeze for Map

§

impl !RefUnwindSafe for Map

§

impl Send for Map

§

impl Sync for Map

§

impl Unpin for Map

§

impl UnsafeUnpin for Map

§

impl !UnwindSafe for Map

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
§

impl<T> DropFlavorWrapper<T> for T

§

type Flavor = MayDrop

The DropFlavor that [wrap]s T into Self
Source§

impl<T> ExpectInto for T

Source§

fn expect_into<Dst>(self) -> Dst
where Dst: TryFrom<Self>, Self: Sized,

Source§

impl<T> Expected for T

Source§

fn expected_add(self, rhs: Self) -> Self
where Self: Sized + CheckedAdd,

Source§

fn expected_sub(self, rhs: Self) -> Self
where Self: Sized + CheckedSub,

Source§

fn expected_mul(self, rhs: Self) -> Self
where Self: Sized + CheckedMul,

Source§

fn expected_div(self, rhs: Self) -> Self
where Self: Sized + CheckedDiv,

Source§

fn expected_rem(self, rhs: Self) -> Self
where Self: Sized + CheckedRem,

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

§

impl<T, W> HasTypeWitness<W> for T
where W: MakeTypeWitness<Arg = T>, T: ?Sized,

§

const WITNESS: W = W::MAKE

A constant of the type witness
§

impl<T> Identity for T
where T: ?Sized,

§

const TYPE_EQ: TypeEq<T, <T as Identity>::Type> = TypeEq::NEW

Proof that Self is the same type as Self::Type, provides methods for casting between Self and Self::Type.
§

type Type = T

The same type as Self, used to emulate type equality bounds (T == U) with associated type equality constraints (T: Identity<Type = U>).
§

impl<T> Instrument for T

§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided [Span], returning an Instrumented wrapper. Read more
§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self>

Converts self into a Left variant of Either<Self, Self> if into_left is true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

Converts self into a Left variant of Either<Self, Self> if into_left(&self) returns true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
§

impl<T> Paint for T
where T: ?Sized,

§

fn fg(&self, value: Color) -> Painted<&T>

Returns a styled value derived from self with the foreground set to value.

This method should be used rarely. Instead, prefer to use color-specific builder methods like red() and green(), which have the same functionality but are pithier.

§Example

Set foreground color to white using fg():

use yansi::{Paint, Color};

painted.fg(Color::White);

Set foreground color to white using white().

use yansi::Paint;

painted.white();
§

fn primary(&self) -> Painted<&T>

Returns self with the fg() set to [Color :: Primary].

§Example
println!("{}", value.primary());
§

fn fixed(&self, color: u8) -> Painted<&T>

Returns self with the fg() set to [Color :: Fixed].

§Example
println!("{}", value.fixed(color));
§

fn rgb(&self, r: u8, g: u8, b: u8) -> Painted<&T>

Returns self with the fg() set to [Color :: Rgb].

§Example
println!("{}", value.rgb(r, g, b));
§

fn black(&self) -> Painted<&T>

Returns self with the fg() set to [Color :: Black].

§Example
println!("{}", value.black());
§

fn red(&self) -> Painted<&T>

Returns self with the fg() set to [Color :: Red].

§Example
println!("{}", value.red());
§

fn green(&self) -> Painted<&T>

Returns self with the fg() set to [Color :: Green].

§Example
println!("{}", value.green());
§

fn yellow(&self) -> Painted<&T>

Returns self with the fg() set to [Color :: Yellow].

§Example
println!("{}", value.yellow());
§

fn blue(&self) -> Painted<&T>

Returns self with the fg() set to [Color :: Blue].

§Example
println!("{}", value.blue());
§

fn magenta(&self) -> Painted<&T>

Returns self with the fg() set to [Color :: Magenta].

§Example
println!("{}", value.magenta());
§

fn cyan(&self) -> Painted<&T>

Returns self with the fg() set to [Color :: Cyan].

§Example
println!("{}", value.cyan());
§

fn white(&self) -> Painted<&T>

Returns self with the fg() set to [Color :: White].

§Example
println!("{}", value.white());
§

fn bright_black(&self) -> Painted<&T>

Returns self with the fg() set to [Color :: BrightBlack].

§Example
println!("{}", value.bright_black());
§

fn bright_red(&self) -> Painted<&T>

Returns self with the fg() set to [Color :: BrightRed].

§Example
println!("{}", value.bright_red());
§

fn bright_green(&self) -> Painted<&T>

Returns self with the fg() set to [Color :: BrightGreen].

§Example
println!("{}", value.bright_green());
§

fn bright_yellow(&self) -> Painted<&T>

Returns self with the fg() set to [Color :: BrightYellow].

§Example
println!("{}", value.bright_yellow());
§

fn bright_blue(&self) -> Painted<&T>

Returns self with the fg() set to [Color :: BrightBlue].

§Example
println!("{}", value.bright_blue());
§

fn bright_magenta(&self) -> Painted<&T>

Returns self with the fg() set to [Color :: BrightMagenta].

§Example
println!("{}", value.bright_magenta());
§

fn bright_cyan(&self) -> Painted<&T>

Returns self with the fg() set to [Color :: BrightCyan].

§Example
println!("{}", value.bright_cyan());
§

fn bright_white(&self) -> Painted<&T>

Returns self with the fg() set to [Color :: BrightWhite].

§Example
println!("{}", value.bright_white());
§

fn bg(&self, value: Color) -> Painted<&T>

Returns a styled value derived from self with the background set to value.

This method should be used rarely. Instead, prefer to use color-specific builder methods like on_red() and on_green(), which have the same functionality but are pithier.

§Example

Set background color to red using fg():

use yansi::{Paint, Color};

painted.bg(Color::Red);

Set background color to red using on_red().

use yansi::Paint;

painted.on_red();
§

fn on_primary(&self) -> Painted<&T>

Returns self with the bg() set to [Color :: Primary].

§Example
println!("{}", value.on_primary());
§

fn on_fixed(&self, color: u8) -> Painted<&T>

Returns self with the bg() set to [Color :: Fixed].

§Example
println!("{}", value.on_fixed(color));
§

fn on_rgb(&self, r: u8, g: u8, b: u8) -> Painted<&T>

Returns self with the bg() set to [Color :: Rgb].

§Example
println!("{}", value.on_rgb(r, g, b));
§

fn on_black(&self) -> Painted<&T>

Returns self with the bg() set to [Color :: Black].

§Example
println!("{}", value.on_black());
§

fn on_red(&self) -> Painted<&T>

Returns self with the bg() set to [Color :: Red].

§Example
println!("{}", value.on_red());
§

fn on_green(&self) -> Painted<&T>

Returns self with the bg() set to [Color :: Green].

§Example
println!("{}", value.on_green());
§

fn on_yellow(&self) -> Painted<&T>

Returns self with the bg() set to [Color :: Yellow].

§Example
println!("{}", value.on_yellow());
§

fn on_blue(&self) -> Painted<&T>

Returns self with the bg() set to [Color :: Blue].

§Example
println!("{}", value.on_blue());
§

fn on_magenta(&self) -> Painted<&T>

Returns self with the bg() set to [Color :: Magenta].

§Example
println!("{}", value.on_magenta());
§

fn on_cyan(&self) -> Painted<&T>

Returns self with the bg() set to [Color :: Cyan].

§Example
println!("{}", value.on_cyan());
§

fn on_white(&self) -> Painted<&T>

Returns self with the bg() set to [Color :: White].

§Example
println!("{}", value.on_white());
§

fn on_bright_black(&self) -> Painted<&T>

Returns self with the bg() set to [Color :: BrightBlack].

§Example
println!("{}", value.on_bright_black());
§

fn on_bright_red(&self) -> Painted<&T>

Returns self with the bg() set to [Color :: BrightRed].

§Example
println!("{}", value.on_bright_red());
§

fn on_bright_green(&self) -> Painted<&T>

Returns self with the bg() set to [Color :: BrightGreen].

§Example
println!("{}", value.on_bright_green());
§

fn on_bright_yellow(&self) -> Painted<&T>

Returns self with the bg() set to [Color :: BrightYellow].

§Example
println!("{}", value.on_bright_yellow());
§

fn on_bright_blue(&self) -> Painted<&T>

Returns self with the bg() set to [Color :: BrightBlue].

§Example
println!("{}", value.on_bright_blue());
§

fn on_bright_magenta(&self) -> Painted<&T>

Returns self with the bg() set to [Color :: BrightMagenta].

§Example
println!("{}", value.on_bright_magenta());
§

fn on_bright_cyan(&self) -> Painted<&T>

Returns self with the bg() set to [Color :: BrightCyan].

§Example
println!("{}", value.on_bright_cyan());
§

fn on_bright_white(&self) -> Painted<&T>

Returns self with the bg() set to [Color :: BrightWhite].

§Example
println!("{}", value.on_bright_white());
§

fn attr(&self, value: Attribute) -> Painted<&T>

Enables the styling [Attribute] value.

This method should be used rarely. Instead, prefer to use attribute-specific builder methods like bold() and underline(), which have the same functionality but are pithier.

§Example

Make text bold using attr():

use yansi::{Paint, Attribute};

painted.attr(Attribute::Bold);

Make text bold using using bold().

use yansi::Paint;

painted.bold();
§

fn bold(&self) -> Painted<&T>

Returns self with the attr() set to [Attribute :: Bold].

§Example
println!("{}", value.bold());
§

fn dim(&self) -> Painted<&T>

Returns self with the attr() set to [Attribute :: Dim].

§Example
println!("{}", value.dim());
§

fn italic(&self) -> Painted<&T>

Returns self with the attr() set to [Attribute :: Italic].

§Example
println!("{}", value.italic());
§

fn underline(&self) -> Painted<&T>

Returns self with the attr() set to [Attribute :: Underline].

§Example
println!("{}", value.underline());

Returns self with the attr() set to [Attribute :: Blink].

§Example
println!("{}", value.blink());

Returns self with the attr() set to [Attribute :: RapidBlink].

§Example
println!("{}", value.rapid_blink());
§

fn invert(&self) -> Painted<&T>

Returns self with the attr() set to [Attribute :: Invert].

§Example
println!("{}", value.invert());
§

fn conceal(&self) -> Painted<&T>

Returns self with the attr() set to [Attribute :: Conceal].

§Example
println!("{}", value.conceal());
§

fn strike(&self) -> Painted<&T>

Returns self with the attr() set to [Attribute :: Strike].

§Example
println!("{}", value.strike());
§

fn quirk(&self, value: Quirk) -> Painted<&T>

Enables the yansi [Quirk] value.

This method should be used rarely. Instead, prefer to use quirk-specific builder methods like mask() and wrap(), which have the same functionality but are pithier.

§Example

Enable wrapping using .quirk():

use yansi::{Paint, Quirk};

painted.quirk(Quirk::Wrap);

Enable wrapping using wrap().

use yansi::Paint;

painted.wrap();
§

fn mask(&self) -> Painted<&T>

Returns self with the quirk() set to [Quirk :: Mask].

§Example
println!("{}", value.mask());
§

fn wrap(&self) -> Painted<&T>

Returns self with the quirk() set to [Quirk :: Wrap].

§Example
println!("{}", value.wrap());
§

fn linger(&self) -> Painted<&T>

Returns self with the quirk() set to [Quirk :: Linger].

§Example
println!("{}", value.linger());
§

fn clear(&self) -> Painted<&T>

👎Deprecated since 1.0.1:

renamed to resetting() due to conflicts with Vec::clear(). The clear() method will be removed in a future release.

Returns self with the quirk() set to [Quirk :: Clear].

§Example
println!("{}", value.clear());
§

fn resetting(&self) -> Painted<&T>

Returns self with the quirk() set to [Quirk :: Resetting].

§Example
println!("{}", value.resetting());
§

fn bright(&self) -> Painted<&T>

Returns self with the quirk() set to [Quirk :: Bright].

§Example
println!("{}", value.bright());
§

fn on_bright(&self) -> Painted<&T>

Returns self with the quirk() set to [Quirk :: OnBright].

§Example
println!("{}", value.on_bright());
§

fn whenever(&self, value: Condition) -> Painted<&T>

Conditionally enable styling based on whether the [Condition] value applies. Replaces any previous condition.

See the crate level docs for more details.

§Example

Enable styling painted only when both stdout and stderr are TTYs:

use yansi::{Paint, Condition};

painted.red().on_yellow().whenever(Condition::STDOUTERR_ARE_TTY);
§

fn new(self) -> Painted<Self>
where Self: Sized,

Create a new [Painted] with a default [Style]. Read more
§

fn paint<S>(&self, style: S) -> Painted<&Self>
where S: Into<Style>,

Apply a style wholesale to self. Any previous style is replaced. Read more
§

impl<T> PolicyExt for T
where T: ?Sized,

§

fn and<P, B, E>(self, other: P) -> And<T, P>
where T: Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns [Action::Follow] only if self and other return Action::Follow. Read more
§

fn or<P, B, E>(self, other: P) -> Or<T, P>
where T: Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns [Action::Follow] if either self or other returns Action::Follow. Read more
Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
§

impl<T> ServiceExt for T

§

fn add_extension<T>(self, value: T) -> AddExtension<Self, T>
where Self: Sized,

Add some shareable value to request extensions. Read more
§

fn compression(self) -> Compression<Self>
where Self: Sized,

Compresses response bodies. Read more
§

fn decompression(self) -> Decompression<Self>
where Self: Sized,

Decompress response bodies. Read more
§

fn trace_for_http(self) -> Trace<Self, SharedClassifier<ServerErrorsAsFailures>>
where Self: Sized,

High level tracing that classifies responses using HTTP status codes. Read more
§

fn trace_for_grpc(self) -> Trace<Self, SharedClassifier<GrpcErrorsAsFailures>>
where Self: Sized,

High level tracing that classifies responses using gRPC headers. Read more
§

fn follow_redirects(self) -> FollowRedirect<Self>
where Self: Sized,

Follow redirect resposes using the Standard policy. Read more
§

fn sensitive_headers( self, headers: impl IntoIterator<Item = HeaderName>, ) -> SetSensitiveRequestHeaders<SetSensitiveResponseHeaders<Self>>
where Self: Sized,

Mark headers as sensitive on both requests and responses. Read more
§

fn sensitive_request_headers( self, headers: impl IntoIterator<Item = HeaderName>, ) -> SetSensitiveRequestHeaders<Self>
where Self: Sized,

Mark headers as sensitive on requests. Read more
§

fn sensitive_response_headers( self, headers: impl IntoIterator<Item = HeaderName>, ) -> SetSensitiveResponseHeaders<Self>
where Self: Sized,

Mark headers as sensitive on responses. Read more
§

fn override_request_header<M>( self, header_name: HeaderName, make: M, ) -> SetRequestHeader<Self, M>
where Self: Sized,

Insert a header into the request. Read more
§

fn append_request_header<M>( self, header_name: HeaderName, make: M, ) -> SetRequestHeader<Self, M>
where Self: Sized,

Append a header into the request. Read more
§

fn insert_request_header_if_not_present<M>( self, header_name: HeaderName, make: M, ) -> SetRequestHeader<Self, M>
where Self: Sized,

Insert a header into the request, if the header is not already present. Read more
§

fn override_response_header<M>( self, header_name: HeaderName, make: M, ) -> SetResponseHeader<Self, M>
where Self: Sized,

Insert a header into the response. Read more
§

fn append_response_header<M>( self, header_name: HeaderName, make: M, ) -> SetResponseHeader<Self, M>
where Self: Sized,

Append a header into the response. Read more
§

fn insert_response_header_if_not_present<M>( self, header_name: HeaderName, make: M, ) -> SetResponseHeader<Self, M>
where Self: Sized,

Insert a header into the response, if the header is not already present. Read more
§

fn catch_panic(self) -> CatchPanic<Self, DefaultResponseForPanic>
where Self: Sized,

Catch panics and convert them into 500 Internal Server responses. Read more
Source§

impl<T> ToString for T
where T: Display + ?Sized,

Source§

fn to_string(&self) -> String

Converts the given value to a String. Read more
§

impl<T> ToStringFallible for T
where T: Display,

§

fn try_to_string(&self) -> Result<String, TryReserveError>

ToString::to_string, but without panic on OOM.

Source§

impl<T> Tried for T

Source§

fn try_add(self, rhs: Self) -> Result<Self, Error>
where Self: Sized + CheckedAdd,

Source§

fn try_sub(self, rhs: Self) -> Result<Self, Error>
where Self: Sized + CheckedSub,

Source§

fn try_mul(self, rhs: Self) -> Result<Self, Error>
where Self: Sized + CheckedMul,

Source§

fn try_div(self, rhs: Self) -> Result<Self, Error>
where Self: Sized + CheckedDiv,

Source§

fn try_rem(self, rhs: Self) -> Result<Self, Error>
where Self: Sized + CheckedRem,

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<T> WithSubscriber for T

§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a [WithDispatch] wrapper. Read more
§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a [WithDispatch] wrapper. Read more
§

impl<T> JsonCastable<CanonicalJsonValue> for T

§

impl<T> JsonCastable<Value> for T