pub enum BitfieldEncoding {
Signed(u8),
Unsigned(u8),
}Expand description
Encodes data into binary format. Bitfield integer encoding type supporting signed and unsigned bit widths. BITFIELD 整数类型编码(对标 Apache Kvrocks BitfieldEncoding)
Variants§
Implementations§
Source§impl BitfieldEncoding
impl BitfieldEncoding
pub fn signed(bits: u8) -> Result<Self>
pub fn unsigned(bits: u8) -> Result<Self>
pub const fn is_signed(&self) -> bool
pub const fn is_unsigned(&self) -> bool
pub const fn bits(&self) -> u8
Sourcepub fn positional_offset(&self, index: u64) -> Result<u64>
pub fn positional_offset(&self, index: u64) -> Result<u64>
Calculates absolute bit offset from positional index #N aligned with Redis / Kvrocks syntax. 根据位置索引 #N 计算绝对位偏移(对标 Redis / Kvrocks #N 语法)
Trait Implementations§
Source§impl Clone for BitfieldEncoding
impl Clone for BitfieldEncoding
Source§fn clone(&self) -> BitfieldEncoding
fn clone(&self) -> BitfieldEncoding
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreimpl Copy for BitfieldEncoding
Source§impl Debug for BitfieldEncoding
impl Debug for BitfieldEncoding
impl<'__de> Decode<'__de> for BitfieldEncodingwhere
'__de:,
Source§impl Display for BitfieldEncoding
impl Display for BitfieldEncoding
impl Encode for BitfieldEncoding
impl Eq for BitfieldEncoding
Source§impl FromStr for BitfieldEncoding
impl FromStr for BitfieldEncoding
Source§impl PartialEq for BitfieldEncoding
impl PartialEq for BitfieldEncoding
impl StructuralPartialEq for BitfieldEncoding
Auto Trait Implementations§
impl Freeze for BitfieldEncoding
impl RefUnwindSafe for BitfieldEncoding
impl Send for BitfieldEncoding
impl Sync for BitfieldEncoding
impl Unpin for BitfieldEncoding
impl UnsafeUnpin for BitfieldEncoding
impl UnwindSafe for BitfieldEncoding
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.