pub struct RespCodec { /* private fields */ }Expand description
Tokio codec for RESP3 frame encoding/decoding, backed by resp-rs.
Decoding enforces the RespLimits the codec was built with; encoding is
unaffected, since outbound frames are ones this client built itself.
Attributes and streamed RESP3 encodings fail closed with an unsupported-
operation error until their metadata/sequence can be attached to one reply.
Errors and incomplete input leave the receive buffer unchanged.
Implementations§
Source§impl RespCodec
impl RespCodec
Sourcepub fn with_limits(limits: RespLimits) -> RespCodec
pub fn with_limits(limits: RespLimits) -> RespCodec
A codec with explicit decode limits.
Sourcepub fn limits(&self) -> RespLimits
pub fn limits(&self) -> RespLimits
The limits this codec enforces while decoding.
Trait Implementations§
impl Copy for RespCodec
Source§impl Decoder for RespCodec
impl Decoder for RespCodec
Source§type Error = ProtocolError
type Error = ProtocolError
The type of unrecoverable frame decoding errors. Read more
Source§fn decode(&mut self, src: &mut BytesMut) -> Result<Option<Frame>, ProtocolError>
fn decode(&mut self, src: &mut BytesMut) -> Result<Option<Frame>, ProtocolError>
Attempts to decode a frame from the provided buffer of bytes. Read more
Auto Trait Implementations§
impl Freeze for RespCodec
impl RefUnwindSafe for RespCodec
impl Send for RespCodec
impl Sync for RespCodec
impl Unpin for RespCodec
impl UnsafeUnpin for RespCodec
impl UnwindSafe for RespCodec
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