pub struct AsyncRespCodec<T> { /* private fields */ }Expand description
Buffered RESP3 codec over an AsyncTransport.
Implementations§
Source§impl<T: AsyncTransport> AsyncRespCodec<T>
impl<T: AsyncTransport> AsyncRespCodec<T>
Sourcepub fn new(transport: T) -> Self
pub fn new(transport: T) -> Self
Wrap a transport. Matches the blocking client’s 8 KiB initial
buffer capacity + 8 KiB read chunk — same memory footprint per
connection as RespClient.
Sourcepub fn into_inner(self) -> T
pub fn into_inner(self) -> T
Get the underlying transport back (e.g. to swap it or close it explicitly).
Sourcepub async fn request(&mut self, args: &[Vec<u8>]) -> Result<Reply>
pub async fn request(&mut self, args: &[Vec<u8>]) -> Result<Reply>
Send one command (args = multibulk argv) and await exactly one
reply. Direct async mirror of RespClient::request.
Sourcepub async fn send(&mut self, args: &[Vec<u8>]) -> Result<()>
pub async fn send(&mut self, args: &[Vec<u8>]) -> Result<()>
Encode + write a single command without waiting for a reply.
Used by [crate::AsyncSubscriber]: SUBSCRIBE / PSUBSCRIBE etc.
don’t return replies in the conventional sense — the server
pushes ack frames that are drained later by read_reply.
Sourcepub async fn read_reply(&mut self) -> Result<Reply>
pub async fn read_reply(&mut self) -> Result<Reply>
Drain one parsed reply from the read buffer, reading more bytes from the transport as needed. Pipelining (T4.16) calls this N times after a single batched write.