pub enum DecodedFrame<T: Resp3Frame> {
Streaming(StreamedFrame<T>),
Complete(T),
}
Available on crate feature
resp3
only.Expand description
An enum describing the possible return types from the stream decoding interface.
Variants§
Streaming(StreamedFrame<T>)
Complete(T)
Implementations§
Source§impl<T: Resp3Frame> DecodedFrame<T>
impl<T: Resp3Frame> DecodedFrame<T>
Sourcepub fn add_attributes(
&mut self,
attributes: T::Attributes,
) -> Result<(), RedisProtocolError>
pub fn add_attributes( &mut self, attributes: T::Attributes, ) -> Result<(), RedisProtocolError>
Add attributes to the decoded frame, if possible.
Sourcepub fn into_complete_frame(self) -> Result<T, RedisProtocolError>
pub fn into_complete_frame(self) -> Result<T, RedisProtocolError>
Convert the decoded frame to a complete frame, returning an error if a streaming variant is found.
Sourcepub fn into_streaming_frame(
self,
) -> Result<StreamedFrame<T>, RedisProtocolError>
pub fn into_streaming_frame( self, ) -> Result<StreamedFrame<T>, RedisProtocolError>
Convert the decoded frame into a streaming frame, returning an error if a complete variant is found.
Sourcepub fn is_streaming(&self) -> bool
pub fn is_streaming(&self) -> bool
Whether the decoded frame starts a stream.
Sourcepub fn is_complete(&self) -> bool
pub fn is_complete(&self) -> bool
Whether the decoded frame is a complete frame.
Trait Implementations§
Source§impl<T: Debug + Resp3Frame> Debug for DecodedFrame<T>
impl<T: Debug + Resp3Frame> Debug for DecodedFrame<T>
Source§impl<T: PartialEq + Resp3Frame> PartialEq for DecodedFrame<T>
impl<T: PartialEq + Resp3Frame> PartialEq for DecodedFrame<T>
impl<T: Eq + Resp3Frame> Eq for DecodedFrame<T>
impl<T: Resp3Frame> StructuralPartialEq for DecodedFrame<T>
Auto Trait Implementations§
impl<T> Freeze for DecodedFrame<T>where
T: Freeze,
impl<T> RefUnwindSafe for DecodedFrame<T>where
T: RefUnwindSafe,
impl<T> Send for DecodedFrame<T>where
T: Send,
impl<T> Sync for DecodedFrame<T>where
T: Sync,
impl<T> Unpin for DecodedFrame<T>where
T: Unpin,
impl<T> UnwindSafe for DecodedFrame<T>where
T: UnwindSafe,
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