Enum redis_protocol::resp3::types::DecodedFrame
source · 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>
source§fn eq(&self, other: &DecodedFrame<T>) -> bool
fn eq(&self, other: &DecodedFrame<T>) -> bool
This method tests for
self and other values to be equal, and is used
by ==.impl<T: Eq + Resp3Frame> Eq for DecodedFrame<T>
impl<T: Resp3Frame> StructuralPartialEq for DecodedFrame<T>
Auto Trait Implementations§
impl<T> Freeze for DecodedFrame<T>
impl<T> RefUnwindSafe for DecodedFrame<T>
impl<T> Send for DecodedFrame<T>
impl<T> Sync for DecodedFrame<T>
impl<T> Unpin for DecodedFrame<T>
impl<T> UnwindSafe for DecodedFrame<T>
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