pub struct TransactionReplies { /* private fields */ }Expand description
Typed cursor over the per-queued-command replies of a successful
EXEC. Produced by Transaction::exec_typed /
Transaction::exec_watched_typed. Each next_* consumes one
reply; if the variant doesn’t match the extractor, an
io::ErrorKind::InvalidData is returned and the cursor advances
regardless (so a downstream expect_empty still works correctly).
Implementations§
Source§impl TransactionReplies
impl TransactionReplies
Sourcepub fn expect_empty(&mut self) -> Result<()>
pub fn expect_empty(&mut self) -> Result<()>
Error out if the cursor still has replies — useful at the end of a typed read sequence to assert the queued-command count matched.
Sourcepub fn raw(&mut self) -> Result<Reply>
pub fn raw(&mut self) -> Result<Reply>
Pop the next reply as a raw Reply. Escape hatch for verbs
the typed extractors don’t cover.
Sourcepub fn next_ok_or_nil(&mut self) -> Result<bool>
pub fn next_ok_or_nil(&mut self) -> Result<bool>
Expect Reply::Simple(b"OK") OR Reply::Nil — SET key v NX/XX
returns Nil when the condition is not met.
Sourcepub fn next_bulk(&mut self) -> Result<Option<Vec<u8>>>
pub fn next_bulk(&mut self) -> Result<Option<Vec<u8>>>
Expect Reply::Bulk (or Nil → None) — GET.
Sourcepub fn next_array_of_bulks(&mut self) -> Result<Vec<Option<Vec<u8>>>>
pub fn next_array_of_bulks(&mut self) -> Result<Vec<Option<Vec<u8>>>>
Expect Reply::Array of Bulk/Nil entries — MGET. Returns
Vec<Option<Vec<u8>>> in request order.
Sourcepub fn next_simple(&mut self) -> Result<Vec<u8>>
pub fn next_simple(&mut self) -> Result<Vec<u8>>
Expect Reply::Simple (any payload) — for verbs whose ack isn’t
OK (e.g. PING → +PONG).