pub struct Map {
name: &'static str,
watch: Watch,
cf: Arc<ColumnFamily>,
engine: Arc<Engine>,
read_options: ReadOptions,
cache_read_options: ReadOptions,
write_options: WriteOptions,
}Expand description
Provides typed and raw access to one RocksDB column family.
A map retains its column-family handle and the engine that owns it. Point operations reuse read and write options prepared when the map opens.
Fields§
§name: &'static str§watch: Watch§cf: Arc<ColumnFamily>§engine: Arc<Engine>§read_options: ReadOptions§cache_read_options: ReadOptions§write_options: WriteOptionsImplementations§
Source§impl Map
impl Map
Sourcepub async fn clear(self: &Arc<Self>)
pub async fn clear(self: &Arc<Self>)
Deletes all entries that exist when the clear scan begins.
The operation scans a consistent iterator view, so later writes can remain. When debug assertions are disabled, scan errors are filtered after any preceding keys have been removed.
§Panics
Panics if a scan error occurs with debug assertions enabled, RocksDB rejects a deletion, or an uncorked flush fails.
Source§impl Map
impl Map
Sourcepub fn for_clear(self: &Arc<Self>) -> impl Stream<Item = Result<Key<'_>>> + Send
pub fn for_clear(self: &Arc<Self>) -> impl Stream<Item = Result<Key<'_>>> + Send
Deletes each entry visible to a clear scan and yields its key.
The iterator view is fixed when the stream begins, so later writes can remain. Polling drives deletion and exposes scan errors to the caller. Each yielded key borrows cursor storage and must not be retained across another poll.
§Panics
Panics if RocksDB rejects a deletion or an uncorked flush fails.
Source§impl Map
impl Map
Sourcepub fn compact_blocking(&self, opts: Options) -> Result
pub fn compact_blocking(&self, opts: Options) -> Result
Compacts this map synchronously with the supplied options.
The key range and supported target placement are forwarded to RocksDB manual compaction. Unsupported level combinations and invalid target levels are returned to the caller.
Source§impl Map
impl Map
Sourcepub fn contains<K>(
self: &Arc<Self>,
key: &K,
) -> impl Future<Output = bool> + Send + '_ + use<'_, K>
pub fn contains<K>( self: &Arc<Self>, key: &K, ) -> impl Future<Output = bool> + Send + '_ + use<'_, K>
Checks whether a serialized key exists.
The key is encoded into an owned buffer before asynchronous raw-key lookup.
Missing keys and database errors are folded into false.
§Panics
Panics if the key cannot be serialized.
Source§impl Map
impl Map
Sourcepub fn acontains<const MAX: usize, K>(
self: &Arc<Self>,
key: &K,
) -> impl Future<Output = bool> + Send + '_ + use<'_, MAX, K>
pub fn acontains<const MAX: usize, K>( self: &Arc<Self>, key: &K, ) -> impl Future<Output = bool> + Send + '_ + use<'_, MAX, K>
Checks whether a serialized key exists using fixed-capacity storage.
MAX bounds the complete encoded key without a heap fallback. Missing keys
and database errors are folded into false.
§Panics
Panics if the encoded key exceeds MAX or serialization otherwise fails.
Source§impl Map
impl Map
Sourcepub fn bcontains<K, B>(
self: &Arc<Self>,
key: &K,
buf: &mut B,
) -> impl Future<Output = bool> + Send + '_ + use<'_, K, B>
pub fn bcontains<K, B>( self: &Arc<Self>, key: &K, buf: &mut B, ) -> impl Future<Output = bool> + Send + '_ + use<'_, K, B>
Checks whether a serialized key exists using a caller-supplied buffer.
Serialization appends to the supplied buffer, and lookup uses its full
resulting contents. Missing keys and database errors are folded into
false.
§Panics
Panics if the key cannot be serialized.
Source§impl Map
impl Map
Source§impl Map
impl Map
Sourcepub fn exists_blocking<K>(&self, key: &K) -> Result
pub fn exists_blocking<K>(&self, key: &K) -> Result
Checks synchronously whether a raw key exists.
A cache-tier existence hint can avoid a point read when absence is certain. Missing keys return the map’s not-found error, while database failures remain errors.
Source§impl Map
impl Map
Sourcepub fn count_from<'a, P>(
self: &'a Arc<Self>,
from: &P,
) -> impl Future<Output = usize> + Send + 'a + use<'a, P>
pub fn count_from<'a, P>( self: &'a Arc<Self>, from: &P, ) -> impl Future<Output = usize> + Send + 'a + use<'a, P>
Counts forward scan items at or after a serialized lower bound.
The bound is encoded with the database serializer before seeking. Iterator failures are counted as yielded items rather than returned to the caller.
§Panics
Panics if the lower bound cannot be serialized.
Source§impl Map
impl Map
Sourcepub fn raw_count_from<'a, P>(
self: &'a Arc<Self>,
from: &'a P,
) -> impl Future<Output = usize> + Send + 'a
pub fn raw_count_from<'a, P>( self: &'a Arc<Self>, from: &'a P, ) -> impl Future<Output = usize> + Send + 'a
Counts forward scan items at or after a raw lower bound.
The supplied bytes are used directly as the seek key. Iterator failures are counted as yielded items rather than returned to the caller.
Source§impl Map
impl Map
Sourcepub fn count_prefix<'a, P>(
self: &'a Arc<Self>,
prefix: &P,
) -> impl Future<Output = usize> + Send + 'a + use<'a, P>
pub fn count_prefix<'a, P>( self: &'a Arc<Self>, prefix: &P, ) -> impl Future<Output = usize> + Send + 'a + use<'a, P>
Counts forward scan items matching a serialized prefix.
The prefix is encoded with the database serializer before seeking. Iterator failures are counted as yielded items rather than returned to the caller.
§Panics
Panics if the prefix cannot be serialized.
Source§impl Map
impl Map
Sourcepub fn raw_count_prefix<'a, P>(
self: &'a Arc<Self>,
prefix: &'a P,
) -> impl Future<Output = usize> + Send + 'a
pub fn raw_count_prefix<'a, P>( self: &'a Arc<Self>, prefix: &'a P, ) -> impl Future<Output = usize> + Send + 'a
Counts forward scan items matching a raw prefix.
The supplied bytes are used directly for the seek and prefix test. Iterator failures are counted as yielded items rather than returned to the caller.
Source§impl Map
impl Map
Sourcepub fn del<K>(&self, key: K)
pub fn del<K>(&self, key: K)
Deletes a serialized key using an owned buffer.
The database serializer encodes the key before raw deletion. Matching watchers are notified after RocksDB accepts the removal.
§Panics
Panics if serialization fails, RocksDB rejects the deletion, or an uncorked flush fails.
Source§impl Map
impl Map
Sourcepub fn adel<const MAX: usize, K>(&self, key: K)
pub fn adel<const MAX: usize, K>(&self, key: K)
Deletes a serialized key using a fixed-capacity buffer.
MAX bounds the complete encoded key without a heap fallback. Matching
watchers are notified after RocksDB accepts the removal.
§Panics
Panics if the encoded key exceeds MAX, serialization otherwise fails,
RocksDB rejects the deletion, or an uncorked flush fails.
Source§impl Map
impl Map
Sourcepub fn bdel<K, B>(&self, key: K, buf: &mut B)
pub fn bdel<K, B>(&self, key: K, buf: &mut B)
Deletes a serialized key using a caller-supplied buffer.
Serialization appends the encoded key to the supplied buffer, and deletion uses its full resulting contents. Matching watchers are notified after RocksDB accepts the removal.
§Panics
Panics if serialization fails, RocksDB rejects the deletion, or an uncorked flush fails.
Source§impl Map
impl Map
Sourcepub async fn del_prefix<P>(self: &Arc<Self>, prefix: &P)
pub async fn del_prefix<P>(self: &Arc<Self>, prefix: &P)
Deletes every key visible under a serialized prefix.
The operation scans a consistent iterator view, so later writes can remain. When debug assertions are disabled, scan errors are filtered after any preceding keys have been removed.
§Panics
Panics if the prefix cannot be serialized, a scan error occurs with debug assertions enabled, RocksDB rejects a deletion, or an uncorked flush fails.
Source§impl Map
impl Map
Sourcepub fn get<K>(
self: &Arc<Self>,
key: &K,
) -> impl Future<Output = Result<Handle<'_>>> + Send + use<'_, K>
pub fn get<K>( self: &Arc<Self>, key: &K, ) -> impl Future<Output = Result<Handle<'_>>> + Send + use<'_, K>
Fetches a raw key asynchronously and returns a pinned value handle.
Cache results consume cooperative scheduler budget, while misses run on the engine’s blocking pool. The returned handle keeps its RocksDB value storage pinned for the handle’s lifetime.
Source§impl Map
impl Map
Sourcefn get_blocking_opts<K>(
&self,
key: &K,
read_options: &ReadOptions,
) -> Result<Option<DBPinnableSlice<'_>>, Error>
fn get_blocking_opts<K>( &self, key: &K, read_options: &ReadOptions, ) -> Result<Option<DBPinnableSlice<'_>>, Error>
Performs a pinned point read with explicit RocksDB read options.
The raw RocksDB result distinguishes absence from storage failure for the caller to classify.
Source§impl Map
impl Map
Source§impl Map
impl Map
Source§impl Map
impl Map
Source§impl Map
impl Map
Sourcefn get_batch_blocking_opts<'a, I, K>(
&self,
keys: I,
read_options: &ReadOptions,
) -> impl Iterator<Item = Result<Option<DBPinnableSlice<'_>>, Error>> + Send + use<'_, I, K>
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>
Performs a batched multi-get with explicit RocksDB read options.
Keys are treated as unsorted because callers do not promise column-comparator order.
Source§impl Map
impl Map
Sourcepub fn insert<K, V>(&self, key: &K, val: V)
pub fn insert<K, V>(&self, key: &K, val: V)
Stores a raw key and raw value in this map.
The write uses the map’s configured options, flushes immediately when the engine is uncorked, and then notifies matching watchers. When the engine is corked, the surrounding cork controls flushing.
§Panics
Panics if RocksDB rejects the write or an uncorked flush fails.
Source§impl Map
impl Map
Sourcepub fn keys_from<'a, K, P>(
self: &'a Arc<Self>,
from: &P,
) -> impl Stream<Item = Result<Key<'_, K>>> + Send + use<'a, K, P>
pub fn keys_from<'a, K, P>( self: &'a Arc<Self>, from: &P, ) -> impl Stream<Item = Result<Key<'_, K>>> + Send + use<'a, K, P>
Streams deserialized keys forward from a serialized lower bound.
The scan begins at the first key not less than the encoded bound. Any borrowed key must not be retained across another poll.
§Panics
Panics if the lower bound cannot be serialized.
Source§impl Map
impl Map
Sourcepub fn keys_from_raw<P>(
self: &Arc<Self>,
from: &P,
) -> impl Stream<Item = Result<Key<'_>>> + Send + use<'_, P>
pub fn keys_from_raw<P>( self: &Arc<Self>, from: &P, ) -> impl Stream<Item = Result<Key<'_>>> + Send + use<'_, P>
Streams raw keys forward from a serialized lower bound.
The scan begins at the first key not less than the encoded bound. Yielded keys borrow cursor storage and must not be retained across another poll.
§Panics
Panics if the lower bound cannot be serialized.
Source§impl Map
impl Map
Sourcepub fn keys_raw_from<'a, K, P>(
self: &'a Arc<Self>,
from: &P,
) -> impl Stream<Item = Result<Key<'_, K>>> + Send + use<'a, K, P>
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>
Streams deserialized keys forward from a raw lower bound.
The supplied bytes are used directly as the seek position. Any borrowed key must not be retained across another poll.
Source§impl Map
impl Map
Sourcepub fn raw_keys_from<P>(
self: &Arc<Self>,
from: &P,
) -> impl Stream<Item = Result<Key<'_>>> + Send + use<'_, P>
pub fn raw_keys_from<P>( self: &Arc<Self>, from: &P, ) -> impl Stream<Item = Result<Key<'_>>> + Send + use<'_, P>
Streams raw keys forward from a raw lower bound.
The supplied bytes are used directly as the seek position. Yielded keys borrow cursor storage and must not be retained across another poll.
Source§impl Map
impl Map
Sourcepub fn keys_prefix<'a, K, P>(
self: &'a Arc<Self>,
prefix: &P,
) -> impl Stream<Item = Result<Key<'_, K>>> + Send + use<'a, K, P>
pub fn keys_prefix<'a, K, P>( self: &'a Arc<Self>, prefix: &P, ) -> impl Stream<Item = Result<Key<'_, K>>> + Send + use<'a, K, P>
Streams deserialized keys matching a serialized prefix in ascending order.
The scan begins at the encoded prefix and stops at the first nonmatching key. Any borrowed key must not be retained across another poll.
§Panics
Panics if the prefix cannot be serialized.
Source§impl Map
impl Map
Sourcepub fn keys_prefix_raw<P>(
self: &Arc<Self>,
prefix: &P,
) -> impl Stream<Item = Result<Key<'_>>> + Send + use<'_, P>
pub fn keys_prefix_raw<P>( self: &Arc<Self>, prefix: &P, ) -> impl Stream<Item = Result<Key<'_>>> + Send + use<'_, P>
Streams raw keys matching a serialized prefix in ascending order.
The scan begins at the encoded prefix and stops at the first nonmatching key. Yielded keys borrow cursor storage and must not be retained across another poll.
§Panics
Panics if the prefix cannot be serialized.
Source§impl Map
impl Map
Sourcepub fn keys_raw_prefix<'a, K, P>(
self: &'a Arc<Self>,
prefix: &'a P,
) -> impl Stream<Item = Result<Key<'_, K>>> + Send + 'a
pub fn keys_raw_prefix<'a, K, P>( self: &'a Arc<Self>, prefix: &'a P, ) -> impl Stream<Item = Result<Key<'_, K>>> + Send + 'a
Streams deserialized keys matching a raw prefix in ascending order.
The supplied bytes are used directly for the seek and prefix test. Any borrowed key must not be retained across another poll.
Source§impl Map
impl Map
Sourcepub fn raw_keys_prefix<'a, P>(
self: &'a Arc<Self>,
prefix: &'a P,
) -> impl Stream<Item = Result<Key<'_>>> + Send + 'a
pub fn raw_keys_prefix<'a, P>( self: &'a Arc<Self>, prefix: &'a P, ) -> impl Stream<Item = Result<Key<'_>>> + Send + 'a
Streams raw keys matching a raw prefix in ascending order.
The supplied bytes are used directly for the seek and prefix test. Yielded keys borrow cursor storage and must not be retained across another poll.
Source§impl Map
impl Map
Sourcepub fn put<K, V>(&self, key: K, val: V)
pub fn put<K, V>(&self, key: K, val: V)
Stores a serialized key and serialized value using owned buffers.
Both values pass through the database serializer before raw insertion. Matching watchers are notified after RocksDB accepts the write.
§Panics
Panics if either value cannot be serialized, RocksDB rejects the write, or an uncorked flush fails.
Source§impl Map
impl Map
Sourcepub fn put_raw<K, V>(&self, key: K, val: V)
pub fn put_raw<K, V>(&self, key: K, val: V)
Stores a serialized key and raw value using an owned key buffer.
The key passes through the database serializer before raw insertion. Matching watchers are notified after RocksDB accepts the write.
§Panics
Panics if the key cannot be serialized, RocksDB rejects the write, or an uncorked flush fails.
Source§impl Map
impl Map
Sourcepub fn raw_put<K, V>(&self, key: K, val: V)
pub fn raw_put<K, V>(&self, key: K, val: V)
Stores a raw key and serialized value using an owned value buffer.
The value passes through the database serializer before raw insertion. Matching watchers are notified after RocksDB accepts the write.
§Panics
Panics if the value cannot be serialized, RocksDB rejects the write, or an uncorked flush fails.
Source§impl Map
impl Map
Sourcepub fn put_aput<const VMAX: usize, K, V>(&self, key: K, val: V)
pub fn put_aput<const VMAX: usize, K, V>(&self, key: K, val: V)
Stores a serialized key and value with fixed-capacity value storage.
The key uses an owned buffer, while VMAX bounds the complete encoded value
without a heap fallback. Matching watchers are notified after RocksDB
accepts the write.
§Panics
Panics if serialization fails, the encoded value exceeds VMAX, RocksDB
rejects the write, or an uncorked flush fails.
Source§impl Map
impl Map
Sourcepub fn aput_put<const KMAX: usize, K, V>(&self, key: K, val: V)
pub fn aput_put<const KMAX: usize, K, V>(&self, key: K, val: V)
Stores a serialized key and value with fixed-capacity key storage.
KMAX bounds the complete encoded key without a heap fallback, while the
value uses an owned buffer. Matching watchers are notified after RocksDB
accepts the write.
§Panics
Panics if serialization fails, the encoded key exceeds KMAX, RocksDB
rejects the write, or an uncorked flush fails.
Source§impl Map
impl Map
Sourcepub fn aput<const KMAX: usize, const VMAX: usize, K, V>(&self, key: K, val: V)
pub fn aput<const KMAX: usize, const VMAX: usize, K, V>(&self, key: K, val: V)
Stores a serialized key and value using fixed-capacity buffers.
KMAX and VMAX bound the complete encoded key and value without heap
fallbacks. Matching watchers are notified after RocksDB accepts the write.
§Panics
Panics if serialization fails, either encoded value exceeds its capacity, RocksDB rejects the write, or an uncorked flush fails.
Source§impl Map
impl Map
Sourcepub fn aput_raw<const KMAX: usize, K, V>(&self, key: K, val: V)
pub fn aput_raw<const KMAX: usize, K, V>(&self, key: K, val: V)
Stores a serialized key and raw value with fixed-capacity key storage.
KMAX bounds the complete encoded key without a heap fallback. Matching
watchers are notified after RocksDB accepts the write.
§Panics
Panics if serialization fails, the encoded key exceeds KMAX, RocksDB
rejects the write, or an uncorked flush fails.
Source§impl Map
impl Map
Sourcepub fn raw_aput<const VMAX: usize, K, V>(&self, key: K, val: V)
pub fn raw_aput<const VMAX: usize, K, V>(&self, key: K, val: V)
Stores a raw key and serialized value with fixed-capacity value storage.
VMAX bounds the complete encoded value without a heap fallback. Matching
watchers are notified after RocksDB accepts the write.
§Panics
Panics if serialization fails, the encoded value exceeds VMAX, RocksDB
rejects the write, or an uncorked flush fails.
Source§impl Map
impl Map
Sourcepub fn bput<K, V, Bk, Bv>(&self, key: K, val: V, buf: (Bk, Bv))
pub fn bput<K, V, Bk, Bv>(&self, key: K, val: V, buf: (Bk, Bv))
Stores a serialized key and value using caller-supplied buffers.
Serialization appends the encoded key and value to the tuple’s first and second buffers, respectively. The write uses each buffer’s full resulting contents and then notifies matching watchers after RocksDB accepts it.
§Panics
Panics if either value cannot be serialized, RocksDB rejects the write, or an uncorked flush fails.
Source§impl Map
impl Map
Sourcepub fn bput_raw<K, V, Bk>(&self, key: K, val: V, buf: Bk)
pub fn bput_raw<K, V, Bk>(&self, key: K, val: V, buf: Bk)
Stores a serialized key and raw value using a caller-supplied key buffer.
Serialization appends the encoded key to the supplied buffer, and the write uses its full resulting contents. Matching watchers are notified after RocksDB accepts the write.
§Panics
Panics if the key cannot be serialized, RocksDB rejects the write, or an uncorked flush fails.
Source§impl Map
impl Map
Sourcepub fn raw_bput<K, V, Bv>(&self, key: K, val: V, buf: Bv)
pub fn raw_bput<K, V, Bv>(&self, key: K, val: V, buf: Bv)
Stores a raw key and serialized value using a caller-supplied value buffer.
Serialization appends the encoded value to the supplied buffer, and the write uses its full resulting contents. Matching watchers are notified after RocksDB accepts the write.
§Panics
Panics if the value cannot be serialized, RocksDB rejects the write, or an uncorked flush fails.
Source§impl Map
impl Map
Sourcepub fn qry<K>(
self: &Arc<Self>,
key: &K,
) -> impl Future<Output = Result<Handle<'_>>> + Send + use<'_, K>
pub fn qry<K>( self: &Arc<Self>, key: &K, ) -> impl Future<Output = Result<Handle<'_>>> + Send + use<'_, K>
Fetches a serialized key asynchronously using an owned buffer.
The key is encoded with the database serializer before raw lookup. The returned handle keeps its RocksDB value storage pinned for the handle’s lifetime.
§Panics
Panics if the key cannot be serialized.
Source§impl Map
impl Map
Sourcepub fn aqry<const MAX: usize, K>(
self: &Arc<Self>,
key: &K,
) -> impl Future<Output = Result<Handle<'_>>> + Send + use<'_, MAX, K>
pub fn aqry<const MAX: usize, K>( self: &Arc<Self>, key: &K, ) -> impl Future<Output = Result<Handle<'_>>> + Send + use<'_, MAX, K>
Fetches a serialized key asynchronously using fixed-capacity storage.
MAX bounds the complete encoded key without a heap fallback. The returned
handle keeps its RocksDB value storage pinned for the handle’s lifetime.
§Panics
Panics if the encoded key exceeds MAX or serialization otherwise fails.
Source§impl Map
impl Map
Sourcepub fn bqry<K, B>(
self: &Arc<Self>,
key: &K,
buf: &mut B,
) -> impl Future<Output = Result<Handle<'_>>> + Send + use<'_, K, B>
pub fn bqry<K, B>( self: &Arc<Self>, key: &K, buf: &mut B, ) -> impl Future<Output = Result<Handle<'_>>> + Send + use<'_, K, B>
Fetches a serialized key asynchronously using a caller-supplied buffer.
Serialization appends to the supplied buffer, and lookup uses its full resulting contents. The returned handle keeps its RocksDB value storage pinned for the handle’s lifetime.
§Panics
Panics if the key cannot be serialized.
Source§impl Map
impl Map
Sourcepub(crate) fn qry_batch<'a, S, K>(
self: &'a Arc<Self>,
keys: S,
) -> impl Stream<Item = Result<Handle<'_>>> + Send + 'a
pub(crate) fn qry_batch<'a, S, K>( self: &'a Arc<Self>, keys: S, ) -> impl Stream<Item = Result<Handle<'_>>> + Send + 'a
Fetches a stream of structured keys in serialized asynchronous batches.
Each batch is encoded, run on the engine’s blocking pool, and flattened back into individual lookup results.
§Panics
Panics if an input key cannot be serialized.
Source§impl Map
impl Map
Sourcepub fn remove<K>(&self, key: &K)
pub fn remove<K>(&self, key: &K)
Deletes a raw key from this map.
The removal uses the map’s configured options, flushes immediately when the engine is uncorked, and then notifies matching watchers. When the engine is corked, the surrounding cork controls flushing.
§Panics
Panics if RocksDB rejects the deletion or an uncorked flush fails.
Source§impl Map
impl Map
Sourcepub fn rev_keys<'a, K>(
self: &'a Arc<Self>,
) -> impl Stream<Item = Result<Key<'_, K>>> + Sendwhere
K: Deserialize<'a> + Send,
pub fn rev_keys<'a, K>(
self: &'a Arc<Self>,
) -> impl Stream<Item = Result<Key<'_, K>>> + Sendwhere
K: Deserialize<'a> + Send,
Streams deserialized keys in descending database order.
Each raw key is decoded with the database deserializer. Any borrowed key must not be retained across another poll.
Source§impl Map
impl Map
Sourcepub fn rev_keys_from<'a, K, P>(
self: &'a Arc<Self>,
from: &P,
) -> impl Stream<Item = Result<Key<'_, K>>> + Send + use<'a, K, P>
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>
Streams deserialized keys backward from a serialized upper bound.
The scan begins at the greatest key not greater than the encoded bound. Any borrowed key must not be retained across another poll.
§Panics
Panics if the upper bound cannot be serialized.
Source§impl Map
impl Map
Sourcepub fn rev_keys_from_raw<P>(
self: &Arc<Self>,
from: &P,
) -> impl Stream<Item = Result<Key<'_>>> + Send + use<'_, P>
pub fn rev_keys_from_raw<P>( self: &Arc<Self>, from: &P, ) -> impl Stream<Item = Result<Key<'_>>> + Send + use<'_, P>
Streams raw keys backward from a serialized upper bound.
The scan begins at the greatest key not greater than the encoded bound. Yielded keys borrow cursor storage and must not be retained across another poll.
§Panics
Panics if the upper bound cannot be serialized.
Source§impl Map
impl Map
Sourcepub 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>
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>
Streams deserialized keys backward from a raw upper bound.
The supplied bytes are used directly as the reverse seek position. Any borrowed key must not be retained across another poll.
Source§impl Map
impl Map
Sourcepub fn rev_raw_keys_from<P>(
self: &Arc<Self>,
from: &P,
) -> impl Stream<Item = Result<Key<'_>>> + Send + use<'_, P>
pub fn rev_raw_keys_from<P>( self: &Arc<Self>, from: &P, ) -> impl Stream<Item = Result<Key<'_>>> + Send + use<'_, P>
Streams raw keys backward from a raw upper bound.
The supplied bytes are used directly as the reverse seek position. Yielded keys borrow cursor storage and must not be retained across another poll.
Source§impl Map
impl Map
Sourcepub fn rev_keys_prefix<'a, K, P>(
self: &'a Arc<Self>,
prefix: &P,
) -> impl Stream<Item = Result<Key<'_, K>>> + Send + use<'a, K, P>
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>
Streams deserialized keys from a reverse seek at a serialized prefix.
The encoded prefix is both the seek position and the predicate. Under bytewise ordering, longer keys with the prefix sort above this starting point, so the scan normally reaches only an exact-key match. Any borrowed key must not be retained across another poll.
§Panics
Panics if the prefix cannot be serialized.
Source§impl Map
impl Map
Sourcepub fn rev_keys_prefix_raw<P>(
self: &Arc<Self>,
prefix: &P,
) -> impl Stream<Item = Result<Key<'_>>> + Send + use<'_, P>
pub fn rev_keys_prefix_raw<P>( self: &Arc<Self>, prefix: &P, ) -> impl Stream<Item = Result<Key<'_>>> + Send + use<'_, P>
Streams raw keys from a reverse seek at a serialized prefix.
The encoded prefix is both the seek position and the predicate. Under bytewise ordering, longer keys with the prefix sort above this starting point, so the scan normally reaches only an exact-key match. Yielded keys borrow cursor storage and must not be retained across another poll.
§Panics
Panics if the prefix cannot be serialized.
Source§impl Map
impl Map
Sourcepub fn rev_keys_raw_prefix<'a, K, P>(
self: &'a Arc<Self>,
prefix: &'a P,
) -> impl Stream<Item = Result<Key<'_, K>>> + Send + 'a
pub fn rev_keys_raw_prefix<'a, K, P>( self: &'a Arc<Self>, prefix: &'a P, ) -> impl Stream<Item = Result<Key<'_, K>>> + Send + 'a
Streams deserialized keys from a reverse seek at a raw prefix.
The supplied bytes are both the seek position and the predicate. Under bytewise ordering, longer keys with the prefix sort above this starting point, so the scan normally reaches only an exact-key match. Any borrowed key must not be retained across another poll.
Source§impl Map
impl Map
Sourcepub fn rev_raw_keys_prefix<'a, P>(
self: &'a Arc<Self>,
prefix: &'a P,
) -> impl Stream<Item = Result<Key<'_>>> + Send + 'a
pub fn rev_raw_keys_prefix<'a, P>( self: &'a Arc<Self>, prefix: &'a P, ) -> impl Stream<Item = Result<Key<'_>>> + Send + 'a
Streams raw keys from a reverse seek at a raw prefix.
The supplied bytes are both the seek position and the predicate. Under bytewise ordering, longer keys with the prefix sort above this starting point, so the scan normally reaches only an exact-key match. Yielded keys borrow cursor storage and must not be retained across another poll.
Source§impl Map
impl Map
Sourcepub fn rev_stream<'a, K, V>(
self: &'a Arc<Self>,
) -> impl Stream<Item = Result<KeyVal<'_, K, V>>> + Send
pub fn rev_stream<'a, K, V>( self: &'a Arc<Self>, ) -> impl Stream<Item = Result<KeyVal<'_, K, V>>> + Send
Streams deserialized key-value entries in descending database order.
Each raw pair is decoded with the database deserializer. Any borrowed key or value must not be retained across another poll of the stream.
Source§impl Map
impl Map
Sourcepub fn rev_raw_stream(
self: &Arc<Self>,
) -> impl Stream<Item = Result<KeyVal<'_>>> + Send
pub fn rev_raw_stream( self: &Arc<Self>, ) -> impl Stream<Item = Result<KeyVal<'_>>> + Send
Streams raw key-value entries in descending database order.
The scan begins at the last key in the column family. Yielded keys and values borrow cursor storage and must not be retained across another poll.
Source§impl Map
impl Map
Sourcepub 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>
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>
Streams deserialized entries backward from a serialized upper bound.
The scan begins at the greatest key not greater than the encoded bound. Any borrowed key or value must not be retained across another poll of the stream.
§Panics
Panics if the upper bound cannot be serialized.
Source§impl Map
impl Map
Sourcepub fn rev_stream_from_raw<P>(
self: &Arc<Self>,
from: &P,
) -> impl Stream<Item = Result<KeyVal<'_>>> + Send + use<'_, P>
pub fn rev_stream_from_raw<P>( self: &Arc<Self>, from: &P, ) -> impl Stream<Item = Result<KeyVal<'_>>> + Send + use<'_, P>
Streams raw entries backward from a serialized upper bound.
The scan begins at the greatest key not greater than the encoded bound. Yielded keys and values borrow cursor storage and must not be retained across another poll.
§Panics
Panics if the upper bound cannot be serialized.
Source§impl Map
impl Map
Sourcepub 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>
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>
Streams deserialized entries backward from a raw upper bound.
The supplied bytes are used directly as the reverse seek position. Any borrowed key or value must not be retained across another poll of the stream.
Source§impl Map
impl Map
Sourcepub fn rev_raw_stream_from<P>(
self: &Arc<Self>,
from: &P,
) -> impl Stream<Item = Result<KeyVal<'_>>> + Send + use<'_, P>
pub fn rev_raw_stream_from<P>( self: &Arc<Self>, from: &P, ) -> impl Stream<Item = Result<KeyVal<'_>>> + Send + use<'_, P>
Streams raw entries backward from a raw upper bound.
The supplied bytes are used directly as the reverse seek position. Yielded keys and values borrow cursor storage and must not be retained across another poll.
Source§impl Map
impl Map
Sourcepub 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>
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>
Streams deserialized entries from a reverse seek at a serialized prefix.
The encoded prefix is both the seek position and the predicate. Under bytewise ordering, longer keys with the prefix sort above this starting point, so the scan normally reaches only an exact-key match. Any borrowed key or value must not be retained across another poll.
§Panics
Panics if the prefix cannot be serialized.
Source§impl Map
impl Map
Sourcepub fn rev_stream_prefix_raw<P>(
self: &Arc<Self>,
prefix: &P,
) -> impl Stream<Item = Result<KeyVal<'_>>> + Send + use<'_, P>
pub fn rev_stream_prefix_raw<P>( self: &Arc<Self>, prefix: &P, ) -> impl Stream<Item = Result<KeyVal<'_>>> + Send + use<'_, P>
Streams raw entries from a reverse seek at a serialized prefix.
The encoded prefix is both the seek position and the predicate. Under bytewise ordering, longer keys with the prefix sort above this starting point, so the scan normally reaches only an exact-key match. Yielded keys and values borrow cursor storage and must not be retained across another poll.
§Panics
Panics if the prefix cannot be serialized.
Source§impl Map
impl Map
Sourcepub fn rev_stream_raw_prefix<'a, K, V, P>(
self: &'a Arc<Self>,
prefix: &'a P,
) -> impl Stream<Item = Result<KeyVal<'_, K, V>>> + Send + 'awhere
P: AsRef<[u8]> + ?Sized + Debug + Sync + 'a,
K: Deserialize<'a> + Send + 'a,
V: Deserialize<'a> + Send + 'a,
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 + 'awhere
P: AsRef<[u8]> + ?Sized + Debug + Sync + 'a,
K: Deserialize<'a> + Send + 'a,
V: Deserialize<'a> + Send + 'a,
Streams deserialized entries from a reverse seek at a raw prefix.
The supplied bytes are both the seek position and the predicate. Under bytewise ordering, longer keys with the prefix sort above this starting point, so the scan normally reaches only an exact-key match. Any borrowed key or value must not be retained across another poll.
Source§impl Map
impl Map
Sourcepub fn rev_raw_stream_prefix<'a, P>(
self: &'a Arc<Self>,
prefix: &'a P,
) -> impl Stream<Item = Result<KeyVal<'_>>> + Send + 'a
pub fn rev_raw_stream_prefix<'a, P>( self: &'a Arc<Self>, prefix: &'a P, ) -> impl Stream<Item = Result<KeyVal<'_>>> + Send + 'a
Streams raw entries from a reverse seek at a raw prefix.
The supplied bytes are both the seek position and the predicate. Under bytewise ordering, longer keys with the prefix sort above this starting point, so the scan normally reaches only an exact-key match. Yielded keys and values borrow cursor storage and must not be retained across another poll.
Source§impl Map
impl Map
Sourcepub fn stream<'a, K, V>(
self: &'a Arc<Self>,
) -> impl Stream<Item = Result<KeyVal<'_, K, V>>> + Send
pub fn stream<'a, K, V>( self: &'a Arc<Self>, ) -> impl Stream<Item = Result<KeyVal<'_, K, V>>> + Send
Streams deserialized key-value entries in ascending database order.
Each raw pair is decoded with the database deserializer. Any borrowed key or value must not be retained across another poll of the stream.
Source§impl Map
impl Map
Sourcepub 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>
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>
Streams deserialized entries forward from a serialized lower bound.
The scan begins at the first key not less than the encoded bound. Any borrowed key or value must not be retained across another poll of the stream.
§Panics
Panics if the lower bound cannot be serialized.
Source§impl Map
impl Map
Sourcepub fn stream_from_raw<P>(
self: &Arc<Self>,
from: &P,
) -> impl Stream<Item = Result<KeyVal<'_>>> + Send + use<'_, P>
pub fn stream_from_raw<P>( self: &Arc<Self>, from: &P, ) -> impl Stream<Item = Result<KeyVal<'_>>> + Send + use<'_, P>
Streams raw entries forward from a serialized lower bound.
The scan begins at the first key not less than the encoded bound. Yielded keys and values borrow cursor storage and must not be retained across another poll.
§Panics
Panics if the lower bound cannot be serialized.
Source§impl Map
impl Map
Sourcepub 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>
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>
Streams deserialized entries forward from a raw lower bound.
The supplied bytes are used directly as the seek position. Any borrowed key or value must not be retained across another poll of the stream.
Source§impl Map
impl Map
Sourcepub fn raw_stream_from<P>(
self: &Arc<Self>,
from: &P,
) -> impl Stream<Item = Result<KeyVal<'_>>> + Send + use<'_, P>
pub fn raw_stream_from<P>( self: &Arc<Self>, from: &P, ) -> impl Stream<Item = Result<KeyVal<'_>>> + Send + use<'_, P>
Streams raw entries forward from a raw lower bound.
The supplied bytes are used directly as the seek position. Yielded keys and values borrow cursor storage and must not be retained across another poll.
Source§impl Map
impl Map
Sourcepub 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>
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>
Streams deserialized entries matching a serialized prefix in ascending order.
The scan begins at the encoded prefix and stops at the first nonmatching key. Any borrowed key or value must not be retained across another poll of the stream.
§Panics
Panics if the prefix cannot be serialized.
Source§impl Map
impl Map
Sourcepub fn stream_prefix_raw<P>(
self: &Arc<Self>,
prefix: &P,
) -> impl Stream<Item = Result<KeyVal<'_>>> + Send + use<'_, P>
pub fn stream_prefix_raw<P>( self: &Arc<Self>, prefix: &P, ) -> impl Stream<Item = Result<KeyVal<'_>>> + Send + use<'_, P>
Streams raw entries matching a serialized prefix in ascending order.
The scan begins at the encoded prefix and stops at the first nonmatching key. Yielded keys and values borrow cursor storage and must not be retained across another poll.
§Panics
Panics if the prefix cannot be serialized.
Source§impl Map
impl Map
Sourcepub fn stream_raw_prefix<'a, K, V, P>(
self: &'a Arc<Self>,
prefix: &'a P,
) -> impl Stream<Item = Result<KeyVal<'_, K, V>>> + Send + 'awhere
P: AsRef<[u8]> + ?Sized + Debug + Sync + 'a,
K: Deserialize<'a> + Send + 'a,
V: Deserialize<'a> + Send + 'a,
pub fn stream_raw_prefix<'a, K, V, P>(
self: &'a Arc<Self>,
prefix: &'a P,
) -> impl Stream<Item = Result<KeyVal<'_, K, V>>> + Send + 'awhere
P: AsRef<[u8]> + ?Sized + Debug + Sync + 'a,
K: Deserialize<'a> + Send + 'a,
V: Deserialize<'a> + Send + 'a,
Streams deserialized entries matching a raw prefix in ascending order.
The supplied bytes are used directly for the seek and prefix test. Any borrowed key or value must not be retained across another poll of the stream.
Source§impl Map
impl Map
Sourcepub fn raw_stream_prefix<'a, P>(
self: &'a Arc<Self>,
prefix: &'a P,
) -> impl Stream<Item = Result<KeyVal<'_>>> + Send + 'a
pub fn raw_stream_prefix<'a, P>( self: &'a Arc<Self>, prefix: &'a P, ) -> impl Stream<Item = Result<KeyVal<'_>>> + Send + 'a
Streams raw entries matching a raw prefix in ascending order.
The supplied bytes are used directly for the seek and prefix test. Yielded keys and values borrow cursor storage and must not be retained across another poll.
Source§impl Map
impl Map
Sourcepub fn watch_prefix<K>(&self, prefix: K) -> impl Future<Output = ()> + Send + '_where
K: Serialize,
pub fn watch_prefix<K>(&self, prefix: K) -> impl Future<Output = ()> + Send + '_where
K: Serialize,
Waits for the next map mutation under a serialized prefix.
The prefix is encoded once before subscription. The stored subscription is reaped after a later matching notification observes that its receiver has closed.
§Panics
Panics if prefix serialization fails, the watcher mutex is poisoned, or the sender disappears before notification.
Source§impl Map
impl Map
Sourcepub fn watch_raw_prefix_once<K>(
&self,
prefix: K,
) -> impl Future<Output = ()> + Send + '_
pub fn watch_raw_prefix_once<K>( &self, prefix: K, ) -> impl Future<Output = ()> + Send + '_
Waits once for a map mutation under a raw prefix.
The prefix is copied into the subscription table. A drop guard removes the entry immediately when this future owns its last receiver.
§Panics
Panics if the watcher mutex is poisoned or the sender disappears before notification.
Source§impl Map
impl Map
Sourcepub fn watch_raw_prefix<'a, K>(
&self,
prefix: &'a K,
) -> impl Future<Output = ()> + Send + use<K>
pub fn watch_raw_prefix<'a, K>( &self, prefix: &'a K, ) -> impl Future<Output = ()> + Send + use<K>
Waits for the next map mutation under a borrowed raw prefix.
The prefix is copied into the subscription table. The stored subscription is reaped after a later matching notification observes that its receiver has closed.
§Panics
Panics if the watcher mutex is poisoned or the sender disappears before notification.
Source§impl Map
impl Map
Sourcepub(crate) fn notify<K>(&self, key: &K)
pub(crate) fn notify<K>(&self, key: &K)
Notifies subscriptions whose prefixes match a mutated raw key.
Closed subscriptions discovered during the ordered prefix walk are removed in the same critical section. Live subscriptions remain available for later mutations.
§Panics
Panics if the watcher mutex is poisoned.
Source§impl Map
impl Map
Sourcepub(crate) fn open(
engine: &Arc<Engine>,
name: &'static str,
) -> Result<Arc<Self>>
pub(crate) fn open( engine: &Arc<Engine>, name: &'static str, ) -> Result<Arc<Self>>
Opens a map for a named column family.
The returned map keeps the engine alive for at least as long as its column-family handle. Its read and write options are initialized from the engine configuration.
Sourcepub fn sort(&self) -> Result
pub fn sort(&self) -> Result
Flush this map’s memtable to SST files (a RocksDB LSM-tree flush).
Forces the column family’s buffered writes out of memory into the
on-disk LSM tree. An LSM flush, not a libc fflush(3) or fsync(2),
and distinct from the engine’s flush and sync, which act on the
write-ahead log.
Sourcepub fn property_integer(&self, name: &CStr) -> Result<u64>
pub fn property_integer(&self, name: &CStr) -> Result<u64>
Reads an integer RocksDB property for this map.
The property query is scoped to this map’s column family. Engine errors are returned to the caller.
Sourcepub fn property(&self, name: &str) -> Result<String>
pub fn property(&self, name: &str) -> Result<String>
Reads a string RocksDB property for this map.
The property query is scoped to this map’s column family. Engine errors are returned to the caller.
Sourcepub fn name(&self) -> &str
pub fn name(&self) -> &str
Returns the column-family name of this map.
The name is fixed when the map opens and lives for the duration of the process.
Sourcepub(crate) fn engine(&self) -> &Arc<Engine> ⓘ
pub(crate) fn engine(&self) -> &Arc<Engine> ⓘ
Returns the engine that owns this map.
The borrowed Arc keeps the same identity used to open the
column-family handle.
Trait Implementations§
Auto Trait Implementations§
impl !Freeze for Map
impl !RefUnwindSafe for Map
impl !UnwindSafe for Map
impl Send for Map
impl Sync for Map
impl Unpin for Map
impl UnsafeUnpin for Map
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> ExpectInto for T
impl<T> ExpectInto for T
Source§impl<T> Expected for T
impl<T> Expected for T
Source§fn expected_add(self, rhs: Self) -> Selfwhere
Self: Sized + CheckedAdd,
fn expected_add(self, rhs: Self) -> Selfwhere
Self: Sized + CheckedAdd,
rhs with an expectation that the operation is valid. Read moreSource§fn expected_sub(self, rhs: Self) -> Selfwhere
Self: Sized + CheckedSub,
fn expected_sub(self, rhs: Self) -> Selfwhere
Self: Sized + CheckedSub,
rhs with an expectation that the operation is valid. Read moreSource§fn expected_mul(self, rhs: Self) -> Selfwhere
Self: Sized + CheckedMul,
fn expected_mul(self, rhs: Self) -> Selfwhere
Self: Sized + CheckedMul,
rhs with an expectation that the operation is valid. Read moreSource§fn expected_div(self, rhs: Self) -> Selfwhere
Self: Sized + CheckedDiv,
fn expected_div(self, rhs: Self) -> Selfwhere
Self: Sized + CheckedDiv,
rhs with an expectation that the operation is valid. Read moreSource§fn expected_rem(self, rhs: Self) -> Selfwhere
Self: Sized + CheckedRem,
fn expected_rem(self, rhs: Self) -> Selfwhere
Self: Sized + CheckedRem,
§impl<T> Identity for Twhere
T: ?Sized,
impl<T> Identity for Twhere
T: ?Sized,
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
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 moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
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 moreimpl<T> JsonCastable<CanonicalJsonValue> for T
impl<T> JsonCastable<Value> for T
§impl<T> Paint for Twhere
T: ?Sized,
impl<T> Paint for Twhere
T: ?Sized,
§fn fg(&self, value: Color) -> Painted<&T>
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 bright_black(&self) -> Painted<&T>
fn bright_black(&self) -> Painted<&T>
§fn bright_red(&self) -> Painted<&T>
fn bright_red(&self) -> Painted<&T>
§fn bright_green(&self) -> Painted<&T>
fn bright_green(&self) -> Painted<&T>
§fn bright_yellow(&self) -> Painted<&T>
fn bright_yellow(&self) -> Painted<&T>
§fn bright_blue(&self) -> Painted<&T>
fn bright_blue(&self) -> Painted<&T>
§fn bright_magenta(&self) -> Painted<&T>
fn bright_magenta(&self) -> Painted<&T>
§fn bright_cyan(&self) -> Painted<&T>
fn bright_cyan(&self) -> Painted<&T>
§fn bright_white(&self) -> Painted<&T>
fn bright_white(&self) -> Painted<&T>
§fn bg(&self, value: Color) -> Painted<&T>
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>
fn on_primary(&self) -> Painted<&T>
§fn on_magenta(&self) -> Painted<&T>
fn on_magenta(&self) -> Painted<&T>
§fn on_bright_black(&self) -> Painted<&T>
fn on_bright_black(&self) -> Painted<&T>
§fn on_bright_red(&self) -> Painted<&T>
fn on_bright_red(&self) -> Painted<&T>
§fn on_bright_green(&self) -> Painted<&T>
fn on_bright_green(&self) -> Painted<&T>
§fn on_bright_yellow(&self) -> Painted<&T>
fn on_bright_yellow(&self) -> Painted<&T>
§fn on_bright_blue(&self) -> Painted<&T>
fn on_bright_blue(&self) -> Painted<&T>
§fn on_bright_magenta(&self) -> Painted<&T>
fn on_bright_magenta(&self) -> Painted<&T>
§fn on_bright_cyan(&self) -> Painted<&T>
fn on_bright_cyan(&self) -> Painted<&T>
§fn on_bright_white(&self) -> Painted<&T>
fn on_bright_white(&self) -> Painted<&T>
§fn attr(&self, value: Attribute) -> Painted<&T>
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 rapid_blink(&self) -> Painted<&T>
fn rapid_blink(&self) -> Painted<&T>
§fn quirk(&self, value: Quirk) -> Painted<&T>
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 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.
fn clear(&self) -> Painted<&T>
renamed to resetting() due to conflicts with Vec::clear().
The clear() method will be removed in a future release.
§fn whenever(&self, value: Condition) -> Painted<&T>
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);§impl<T> PolicyExt for Twhere
T: ?Sized,
impl<T> PolicyExt for Twhere
T: ?Sized,
§impl<T> ServiceExt for T
impl<T> ServiceExt for T
§fn add_extension<T>(self, value: T) -> AddExtension<Self, T>where
Self: Sized,
fn add_extension<T>(self, value: T) -> AddExtension<Self, T>where
Self: Sized,
§fn compression(self) -> Compression<Self>where
Self: Sized,
fn compression(self) -> Compression<Self>where
Self: Sized,
§fn decompression(self) -> Decompression<Self>where
Self: Sized,
fn decompression(self) -> Decompression<Self>where
Self: Sized,
§fn trace_for_http(self) -> Trace<Self, SharedClassifier<ServerErrorsAsFailures>>where
Self: Sized,
fn trace_for_http(self) -> Trace<Self, SharedClassifier<ServerErrorsAsFailures>>where
Self: Sized,
§fn trace_for_grpc(self) -> Trace<Self, SharedClassifier<GrpcErrorsAsFailures>>where
Self: Sized,
fn trace_for_grpc(self) -> Trace<Self, SharedClassifier<GrpcErrorsAsFailures>>where
Self: Sized,
§fn follow_redirects(self) -> FollowRedirect<Self>where
Self: Sized,
fn follow_redirects(self) -> FollowRedirect<Self>where
Self: Sized,
§fn sensitive_headers(
self,
headers: impl IntoIterator<Item = HeaderName>,
) -> SetSensitiveRequestHeaders<SetSensitiveResponseHeaders<Self>>where
Self: Sized,
fn sensitive_headers(
self,
headers: impl IntoIterator<Item = HeaderName>,
) -> SetSensitiveRequestHeaders<SetSensitiveResponseHeaders<Self>>where
Self: Sized,
§fn sensitive_request_headers(
self,
headers: impl IntoIterator<Item = HeaderName>,
) -> SetSensitiveRequestHeaders<Self>where
Self: Sized,
fn sensitive_request_headers(
self,
headers: impl IntoIterator<Item = HeaderName>,
) -> SetSensitiveRequestHeaders<Self>where
Self: Sized,
§fn sensitive_response_headers(
self,
headers: impl IntoIterator<Item = HeaderName>,
) -> SetSensitiveResponseHeaders<Self>where
Self: Sized,
fn sensitive_response_headers(
self,
headers: impl IntoIterator<Item = HeaderName>,
) -> SetSensitiveResponseHeaders<Self>where
Self: Sized,
§fn override_request_header<M>(
self,
header_name: HeaderName,
make: M,
) -> SetRequestHeader<Self, M>where
Self: Sized,
fn override_request_header<M>(
self,
header_name: HeaderName,
make: M,
) -> SetRequestHeader<Self, M>where
Self: Sized,
§fn append_request_header<M>(
self,
header_name: HeaderName,
make: M,
) -> SetRequestHeader<Self, M>where
Self: Sized,
fn append_request_header<M>(
self,
header_name: HeaderName,
make: M,
) -> SetRequestHeader<Self, M>where
Self: Sized,
§fn insert_request_header_if_not_present<M>(
self,
header_name: HeaderName,
make: M,
) -> SetRequestHeader<Self, M>where
Self: Sized,
fn insert_request_header_if_not_present<M>(
self,
header_name: HeaderName,
make: M,
) -> SetRequestHeader<Self, M>where
Self: Sized,
§fn override_response_header<M>(
self,
header_name: HeaderName,
make: M,
) -> SetResponseHeader<Self, M>where
Self: Sized,
fn override_response_header<M>(
self,
header_name: HeaderName,
make: M,
) -> SetResponseHeader<Self, M>where
Self: Sized,
§fn append_response_header<M>(
self,
header_name: HeaderName,
make: M,
) -> SetResponseHeader<Self, M>where
Self: Sized,
fn append_response_header<M>(
self,
header_name: HeaderName,
make: M,
) -> SetResponseHeader<Self, M>where
Self: Sized,
§fn insert_response_header_if_not_present<M>(
self,
header_name: HeaderName,
make: M,
) -> SetResponseHeader<Self, M>where
Self: Sized,
fn insert_response_header_if_not_present<M>(
self,
header_name: HeaderName,
make: M,
) -> SetResponseHeader<Self, M>where
Self: Sized,
§fn catch_panic(self) -> CatchPanic<Self, DefaultResponseForPanic>where
Self: Sized,
fn catch_panic(self) -> CatchPanic<Self, DefaultResponseForPanic>where
Self: Sized,
500 Internal Server responses. Read moreSource§impl<T> Tried for T
impl<T> Tried for T
Source§fn try_add(self, rhs: Self) -> Result<Self, Error>where
Self: Sized + CheckedAdd,
fn try_add(self, rhs: Self) -> Result<Self, Error>where
Self: Sized + CheckedAdd,
rhs with checked arithmetic. Read moreSource§fn try_sub(self, rhs: Self) -> Result<Self, Error>where
Self: Sized + CheckedSub,
fn try_sub(self, rhs: Self) -> Result<Self, Error>where
Self: Sized + CheckedSub,
rhs with checked arithmetic. Read moreSource§fn try_mul(self, rhs: Self) -> Result<Self, Error>where
Self: Sized + CheckedMul,
fn try_mul(self, rhs: Self) -> Result<Self, Error>where
Self: Sized + CheckedMul,
rhs with checked arithmetic. Read more