Enum redis_protocol::types::Frame [−][src]
pub enum Frame { SimpleString(String), Error(String), Integer(i64), BulkString(Vec<u8>), Array(Vec<Frame>), Moved(String), Ask(String), Null, }
An enum representing a Frame of data. Frames are recursively defined to account for arrays.
Variants
SimpleString(String)
Error(String)
Integer(i64)
BulkString(Vec<u8>)
Array(Vec<Frame>)
Moved(String)
Ask(String)
Null
Methods
impl Frame
[src]
impl Frame
pub fn is_error(&self) -> bool
[src]
pub fn is_error(&self) -> bool
Whether or not the frame is an error.
pub fn is_pubsub_message(&self) -> bool
[src]
pub fn is_pubsub_message(&self) -> bool
Whether or not the frame represents a message on a publish-subscribe channel.
pub fn kind(&self) -> FrameKind
[src]
pub fn kind(&self) -> FrameKind
Read the FrameKind
value for this frame.
pub fn as_str(&self) -> Option<&str>
[src]
pub fn as_str(&self) -> Option<&str>
Attempt to read the frame value as a string slice.
pub fn is_string(&self) -> bool
[src]
pub fn is_string(&self) -> bool
Whether or not the frame is a simple string or bulk string.
pub fn is_null(&self) -> bool
[src]
pub fn is_null(&self) -> bool
Whether or not the frame is Null.
pub fn is_array(&self) -> bool
[src]
pub fn is_array(&self) -> bool
Whether or not the frame is an array of frames.
pub fn is_integer(&self) -> bool
[src]
pub fn is_integer(&self) -> bool
Whether or not the frame is an integer.
pub fn is_moved_or_ask_error(&self) -> bool
[src]
pub fn is_moved_or_ask_error(&self) -> bool
Whether or not the framed is a a Moved or Ask error.
pub fn to_string(&self) -> Option<String>
[src]
pub fn to_string(&self) -> Option<String>
pub fn parse_as_pubsub(self) -> Result<(String, String), Self>
[src]
pub fn parse_as_pubsub(self) -> Result<(String, String), Self>
Attempt to parse the frame as a publish-subscribe message, returning the (channel, message)
tuple
if successful, or the original frame if the inner data is not a publish-subscribe message.
Trait Implementations
impl Clone for Frame
[src]
impl Clone for Frame
fn clone(&self) -> Frame
[src]
fn clone(&self) -> Frame
Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)
1.0.0[src]
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source
. Read more
impl Debug for Frame
[src]
impl Debug for Frame
fn fmt(&self, f: &mut Formatter) -> Result
[src]
fn fmt(&self, f: &mut Formatter) -> Result
Formats the value using the given formatter. Read more
impl Eq for Frame
[src]
impl Eq for Frame
impl PartialEq for Frame
[src]
impl PartialEq for Frame