pub struct Args<'a> { /* private fields */ }Expand description
One command’s arguments, borrowed from the connection’s read buffer.
Index zero is the command name, the same as Redis’s argv, so an argument
index in this file matches the argument index in Redis’s source and in its
error messages.
Implementations§
Source§impl<'a> Args<'a>
impl<'a> Args<'a>
Sourcepub fn new(argv: &'a Argv, buf: &'a [u8]) -> Args<'a>
pub fn new(argv: &'a Argv, buf: &'a [u8]) -> Args<'a>
The arguments of the command argv last decoded out of buf.
Sourcepub fn get(&self, i: usize) -> &'a [u8] ⓘ
pub fn get(&self, i: usize) -> &'a [u8] ⓘ
Argument i, or an empty slice past the end.
Past the end is empty rather than a panic because every caller has already been through the arity check, so an index past the end is a bug in the arity table rather than something a client can cause, and a wrong answer in the reply is a better way to find that bug than a process that stops answering.
Trait Implementations§
Auto Trait Implementations§
impl<'a> Freeze for Args<'a>
impl<'a> RefUnwindSafe for Args<'a>
impl<'a> Send for Args<'a>
impl<'a> Sync for Args<'a>
impl<'a> Unpin for Args<'a>
impl<'a> UnsafeUnpin for Args<'a>
impl<'a> UnwindSafe for Args<'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