Skip to main content

BitmapMeta

Struct BitmapMeta 

Source
pub struct BitmapMeta {
    pub base: KeyMeta,
}
Expand description

位图结构元数据(对标 Apache Kvrocks BitmapMetadata)

Fields§

§base: KeyMeta

Implementations§

Source§

impl BitmapMeta

Source

pub const ENCODED_SIZE: usize = crate::meta::KeyMeta::ENCODED_SIZE

Source

pub const KVROCKS_ENCODED_SIZE: usize = crate::meta::KeyMeta::KVROCKS_COMPLEX_ENCODED_SIZE

Source

pub const fn new(expire_at: u64, version: u64, size: u64) -> Self

Source

pub fn new_with_version(expire_at: u64, size: u64) -> Self

Source

pub const fn size(&self) -> u64

Source

pub const fn version(&self) -> u64

Source

pub const fn expire_at(&self) -> u64

Source

pub const fn ttl(&self, now_ms: u64) -> i64

Source

pub const fn is_empty(&self) -> bool

Source

pub const fn is_expired(&self, now_ms: u64) -> bool

Source

pub fn encode(&self) -> [u8; 26]

Source

pub fn encode_kvrocks(&self) -> Vec<u8>

Source

pub fn decode(bytes: &[u8]) -> Option<Self>

Trait Implementations§

Source§

impl Clone for BitmapMeta

Source§

fn clone(&self) -> BitmapMeta

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Copy for BitmapMeta

Source§

impl Debug for BitmapMeta

Source§

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

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

impl<'__de> Decode<'__de> for BitmapMeta
where '__de:,

Source§

impl Encode for BitmapMeta

Source§

impl Eq for BitmapMeta

Source§

impl MetaOps for BitmapMeta

Source§

const TAG: &[u8]

Metadata key tag slice (e.g. b"sm", b"hm"). meta key 标签(如 b"sm", b"hm"),用于 check_key_not_other_type
Source§

type EncodedBytes = [u8; 26]

Source§

fn decode(bytes: &[u8]) -> Option<Self>

Source§

fn is_expired(&self, now_ms: u64) -> bool

Source§

fn encode_bytes(&self) -> Self::EncodedBytes

Encoded bytes slice for storage write operations without heap allocation. 编码后的字节,用于写入存储(零堆分配)
Source§

fn base(&self) -> &KeyMeta

Returns immutable reference to base KeyMeta. 获取 base 引用(访问 expire_at / ttl 等通用字段)
Source§

fn base_mut(&mut self) -> &mut KeyMeta

Returns mutable reference to base KeyMeta. 获取 base 可变引用(修改 expire_at)
Source§

impl PartialEq for BitmapMeta

Source§

fn eq(&self, other: &BitmapMeta) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

impl StructuralPartialEq for BitmapMeta

Auto Trait Implementations§

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
Source§

impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> DecodeOwned for T
where T: for<'de> Decode<'de>,

Source§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

Source§

fn equivalent(&self, key: &K) -> bool

Checks if this value is equivalent to the given key. Read more
Source§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

Source§

fn equivalent(&self, key: &K) -> bool

Compare self to key and return true if they are equal.
Source§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

Source§

fn equivalent(&self, key: &K) -> bool

Checks if this value is equivalent to the given key. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

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> Pointable for T

Source§

const ALIGN: usize

The alignment of pointer.
Source§

type Init = T

The type for initializers.
Source§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
Source§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
Source§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
Source§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
Source§

impl<T> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

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

Source§

type Error = !

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

fn try_from(value: U) -> Result<T, !>

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.