#[non_exhaustive]pub struct PrefixInfo {
pub keys: u64,
pub expires: u64,
}Expand description
Per-prefix keyspace stats from Store::info_prefix.
let store = kevy_embedded::Store::open(kevy_embedded::Config::default())?;
store.set(b"user:1", b"a")?;
store.set(b"order:1", b"b")?;
let info = store.info_prefix(b"user:");
assert_eq!((info.keys, info.expires), (1, 0));Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Non-exhaustive structs could have additional fields added in future. Therefore, non-exhaustive structs cannot be constructed in external crates using the traditional
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.keys: u64Live keys under the prefix.
let store = kevy_embedded::Store::open(kevy_embedded::Config::default())?;
store.set(b"user:1", b"a")?;
store.set(b"user:2", b"b")?;
store.set(b"order:1", b"c")?;
assert_eq!(store.info_prefix(b"user:").keys, 2);expires: u64How many of them carry a TTL.
let store = kevy_embedded::Store::open(kevy_embedded::Config::default())?;
store.set(b"s:1", b"a")?;
store.set_with_ttl(b"s:2", b"b", std::time::Duration::from_secs(60))?;
assert_eq!(store.info_prefix(b"s:").expires, 1);Trait Implementations§
Source§impl Clone for PrefixInfo
impl Clone for PrefixInfo
impl Copy for PrefixInfo
Source§impl Debug for PrefixInfo
impl Debug for PrefixInfo
Source§impl Default for PrefixInfo
impl Default for PrefixInfo
impl Eq for PrefixInfo
Source§impl Hash for PrefixInfo
impl Hash for PrefixInfo
Source§impl PartialEq for PrefixInfo
impl PartialEq for PrefixInfo
impl StructuralPartialEq for PrefixInfo
Auto Trait Implementations§
impl Freeze for PrefixInfo
impl RefUnwindSafe for PrefixInfo
impl Send for PrefixInfo
impl Sync for PrefixInfo
impl Unpin for PrefixInfo
impl UnsafeUnpin for PrefixInfo
impl UnwindSafe for PrefixInfo
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
Mutably borrows from an owned value. Read more