pub struct SetRequest<'a> { /* private fields */ }Expand description
Builder for SET commands with options.
Implementations§
Source§impl<'a> SetRequest<'a>
impl<'a> SetRequest<'a>
Sourcepub fn encode_parts(&self) -> (Vec<u8>, Vec<u8>)
pub fn encode_parts(&self) -> (Vec<u8>, Vec<u8>)
Encode this SET request as (prefix, suffix) for scatter-gather sends.
The caller supplies the value bytes separately. The full RESP encoding is
[prefix, value, suffix].concat().
- prefix: array header + SET bulk string + key bulk string + value length header (
$Lv\r\n) - suffix:
\r\nafter the value + any option bulk strings (EX/PX/NX/XX)
Sourcepub fn encode(&self, buf: &mut [u8]) -> usize
pub fn encode(&self, buf: &mut [u8]) -> usize
Encode this SET request into a buffer.
Returns the number of bytes written.
Sourcepub fn encoded_len(&self) -> usize
pub fn encoded_len(&self) -> usize
Calculate the encoded length of this request.
Trait Implementations§
Source§impl<'a> Clone for SetRequest<'a>
impl<'a> Clone for SetRequest<'a>
Source§fn clone(&self) -> SetRequest<'a>
fn clone(&self) -> SetRequest<'a>
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl<'a> Freeze for SetRequest<'a>
impl<'a> RefUnwindSafe for SetRequest<'a>
impl<'a> Send for SetRequest<'a>
impl<'a> Sync for SetRequest<'a>
impl<'a> Unpin for SetRequest<'a>
impl<'a> UnsafeUnpin for SetRequest<'a>
impl<'a> UnwindSafe for SetRequest<'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