pub enum Entry<'a> {
Int(i64),
Str(&'a [u8]),
}Expand description
One element, as it is stored.
Redis stores a member that looks like an integer as an integer, so SADD s 1
and SADD s 01 are two different members that are stored two different ways.
Handing back which one it was is what lets a caller answer OBJECT ENCODING
and write an RDB without re-deciding it.
Variants§
Implementations§
Source§impl Entry<'_>
impl Entry<'_>
Sourcepub fn write_to(&self, out: &mut Vec<u8>)
pub fn write_to(&self, out: &mut Vec<u8>)
The element as a client would see it, appended to out.
An integer entry is formatted here, which is the same round trip Redis does on the way out, because the client asked for a member and members are strings on the wire.
Trait Implementations§
impl<'a> Copy for Entry<'a>
impl<'a> Eq for Entry<'a>
impl<'a> StructuralPartialEq for Entry<'a>
Auto Trait Implementations§
impl<'a> Freeze for Entry<'a>
impl<'a> RefUnwindSafe for Entry<'a>
impl<'a> Send for Entry<'a>
impl<'a> Sync for Entry<'a>
impl<'a> Unpin for Entry<'a>
impl<'a> UnsafeUnpin for Entry<'a>
impl<'a> UnwindSafe for Entry<'a>
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