pub struct Codec;
Expand description
Codec to read/write redis values
Trait Implementations§
Source§impl Decoder for Codec
impl Decoder for Codec
Source§type DecodeItem = Response
type DecodeItem = Response
The type of decoded frames.
Source§type DecodeError = Error
type DecodeError = Error
The type of unrecoverable frame decoding errors. Read more
Source§fn decode(
&self,
buf: &mut BytesMut,
) -> Result<Option<Self::DecodeItem>, Self::DecodeError>
fn decode( &self, buf: &mut BytesMut, ) -> Result<Option<Self::DecodeItem>, Self::DecodeError>
Attempts to decode a frame from the provided buffer of bytes.
Source§fn decode_vec(
&self,
src: &mut BytesVec,
) -> Result<Option<Self::DecodeItem>, Self::DecodeError>
fn decode_vec( &self, src: &mut BytesVec, ) -> Result<Option<Self::DecodeItem>, Self::DecodeError>
Attempts to decode a frame from the provided buffer of bytes.
Source§impl Encoder for Codec
impl Encoder for Codec
Source§type EncodeItem = Request
type EncodeItem = Request
The type of items consumed by the
Encoder
Source§type EncodeError = Error
type EncodeError = Error
The type of encoding errors.
Source§fn encode(
&self,
msg: Request,
buf: &mut BytesMut,
) -> Result<(), Self::EncodeError>
fn encode( &self, msg: Request, buf: &mut BytesMut, ) -> Result<(), Self::EncodeError>
Encodes a frame into the buffer provided.
Source§fn encode_vec(
&self,
item: Self::EncodeItem,
dst: &mut BytesVec,
) -> Result<(), Self::EncodeError>
fn encode_vec( &self, item: Self::EncodeItem, dst: &mut BytesVec, ) -> Result<(), Self::EncodeError>
Encodes a frame into the buffer provided.
Auto Trait Implementations§
impl Freeze for Codec
impl RefUnwindSafe for Codec
impl Send for Codec
impl Sync for Codec
impl Unpin for Codec
impl UnwindSafe for Codec
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
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more