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

Implementations

impl Frame[src]

pub fn is_error(&self) -> bool[src]

Whether or not the frame is an error.

pub fn is_pubsub_message(&self) -> bool[src]

Whether or not the frame represents a message on a publish-subscribe channel.

pub fn is_pattern_pubsub_message(&self) -> bool[src]

Whether or not the frame represents a message on a publish-subscribe channel matched against a pattern subscription.

pub fn kind(&self) -> FrameKind[src]

Read the FrameKind value for this frame.

pub fn as_str(&self) -> Option<&str>[src]

Attempt to read the frame value as a string slice.

pub fn is_string(&self) -> bool[src]

Whether or not the frame is a simple string or bulk string.

pub fn is_null(&self) -> bool[src]

Whether or not the frame is Null.

pub fn is_array(&self) -> bool[src]

Whether or not the frame is an array of frames.

pub fn is_integer(&self) -> bool[src]

Whether or not the frame is an integer.

pub fn is_moved_or_ask_error(&self) -> bool[src]

Whether or not the framed is a a Moved or Ask error.

pub fn to_string(&self) -> Option<String>[src]

pub fn parse_as_pubsub(self) -> Result<(String, String), Self>[src]

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.

pub fn to_redirection(&self) -> Result<Redirection, RedisProtocolError<'_>>[src]

Attempt to parse the frame as a cluster redirection.

Trait Implementations

impl Clone for Frame[src]

impl Debug for Frame[src]

impl Eq for Frame[src]

impl<'a> From<&'a Redirection> for Frame[src]

impl From<Redirection> for Frame[src]

impl PartialEq<Frame> for Frame[src]

impl StructuralEq for Frame[src]

impl StructuralPartialEq for Frame[src]

Auto Trait Implementations

impl RefUnwindSafe for Frame

impl Send for Frame

impl Sync for Frame

impl Unpin for Frame

impl UnwindSafe for Frame

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.