pub struct JsonMeta {
pub base: KeyMeta,
pub format: JsonStorageFormat,
}Expand description
Structure metadata. JSON 结构元数据(对标 Apache Kvrocks JsonMetadata 27 字节/26 字节)
Fields§
§base: KeyMeta§format: JsonStorageFormatImplementations§
Source§impl JsonMeta
impl JsonMeta
pub const ENCODED_SIZE: usize
pub const KVROCKS_ENCODED_SIZE: usize
pub fn new(expire_at: u64, version: u64, size: u64) -> Self
pub fn new_with_version(expire_at: u64, size: u64) -> Self
pub fn with_format( format: JsonStorageFormat, expire_at: u64, version: u64, size: u64, ) -> Self
pub fn is_expired(&self, now_ms: u64) -> bool
Sourcepub fn encode(&self) -> [u8; 27]
pub fn encode(&self) -> [u8; 27]
Encodes data into binary format. 编码为标准 27 字节 wedb 元数据头(栈上定长数组,零堆分配)
Sourcepub fn encode_kvrocks(&self) -> [u8; 10]
pub fn encode_kvrocks(&self) -> [u8; 10]
Encodes data into binary format. 编码为 Kvrocks 10 字节紧凑元数据头(栈上定长数组,零堆分配,对标 Kvrocks JsonMetadata)
Methods from Deref<Target = KeyMeta>§
pub const META_64BIT_ENCODING_MASK: u8 = 0x80
pub const META_TYPE_MASK: u8 = 0x0F
pub const ENCODED_SIZE: usize = 26
pub const KVROCKS_COMPLEX_ENCODED_SIZE: usize = 25
pub const KVROCKS_SINGLE_KV_ENCODED_SIZE: usize = 9
pub fn is_expired(&self, now_ms: u64) -> bool
pub fn is_single_kv_type(&self) -> bool
pub fn is_emptyable_type(&self) -> bool
pub fn ttl(&self, now_ms: u64) -> i64
pub fn ttl_ms(&self, now_ms: u64) -> i64
pub fn ttl_sec(&self, now_ms: u64) -> i64
pub fn is_64bit_encoded(&self) -> bool
pub fn common_encoded_size(&self) -> usize
Sourcepub fn encode(&self) -> [u8; 26]
pub fn encode(&self) -> [u8; 26]
Encodes into standard 26-byte metadata header. 编码为标准 26 字节元数据头
Sourcepub fn encode_kvrocks(&self) -> Vec<u8> ⓘ
pub fn encode_kvrocks(&self) -> Vec<u8> ⓘ
Encodes into compact Kvrocks binary format (25-byte composite / 9-byte SingleKV). 编码为 Kvrocks 1:1 紧凑二进制格式(25字节复合类型 / 9字节SingleKV)
Trait Implementations§
impl Copy for JsonMeta
impl<'__de> Decode<'__de> for JsonMetawhere
'__de:,
impl Encode for JsonMeta
impl Eq for JsonMeta
Source§impl MetaOps for JsonMeta
impl MetaOps for JsonMeta
Source§const TAG: &[u8]
const TAG: &[u8]
Metadata key tag slice (e.g.
b"sm", b"hm").
meta key 标签(如 b"sm", b"hm"),用于 check_key_not_other_typetype EncodedBytes = [u8; 27]
fn decode(bytes: &[u8]) -> Option<Self>
fn is_expired(&self, now_ms: u64) -> bool
Source§fn encode_bytes(&self) -> Self::EncodedBytes
fn encode_bytes(&self) -> Self::EncodedBytes
Encoded bytes slice for storage write operations without heap allocation.
编码后的字节,用于写入存储(零堆分配)
impl StructuralPartialEq for JsonMeta
Auto Trait Implementations§
impl Freeze for JsonMeta
impl RefUnwindSafe for JsonMeta
impl Send for JsonMeta
impl Sync for JsonMeta
impl Unpin for JsonMeta
impl UnsafeUnpin for JsonMeta
impl UnwindSafe for JsonMeta
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> DecodeOwned for Twhere
T: for<'de> Decode<'de>,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.