pub enum Encoding {
Int,
Embstr,
Raw,
}Expand description
What OBJECT ENCODING calls a string.
Variants§
Int
The value is an integer, held as an integer.
Embstr
A short string, at or under EMBSTR_MAX bytes.
Raw
Everything else.
Implementations§
Source§impl Encoding
impl Encoding
Sourcepub fn of(bytes: &[u8]) -> Encoding
pub fn of(bytes: &[u8]) -> Encoding
The encoding Redis would choose for these bytes.
Integer first, because SET k 42 is int encoded in Redis whatever the
length, then the embstr boundary. The integer test is Redis’s own
string2ll, which refuses a leading zero, a leading plus and -0, so
SET k 007 stays a three byte string and gives back 007.
Trait Implementations§
impl Copy for Encoding
impl Eq for Encoding
impl StructuralPartialEq for Encoding
Auto Trait Implementations§
impl Freeze for Encoding
impl RefUnwindSafe for Encoding
impl Send for Encoding
impl Sync for Encoding
impl Unpin for Encoding
impl UnsafeUnpin for Encoding
impl UnwindSafe for Encoding
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