pub enum Frame {
    SimpleString(Bytes),
    Error(Str),
    Integer(i64),
    BulkString(Bytes),
    Array(Vec<Frame>),
    Null,
}
Expand description

An enum representing a Frame of data.

Variants

SimpleString(Bytes)

A short non binary-safe string.

Error(Str)

A short non binary-safe string representing an error.

Integer(i64)

A signed 64 bit integer.

BulkString(Bytes)

A binary-safe string.

Array(Vec<Frame>)

An array of frames, arbitrarily nested.

Null

A null value.

Implementations

Replace self with Null, returning the original value.

Whether or not the frame is an error.

Whether or not the frame represents a publish-subscribe message, but not a pattern publish-subscribe message.

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

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

Read the FrameKind value for this frame.

Attempt to read the frame value as a string slice without allocating.

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

Whether or not the frame is Null.

Whether or not the frame is an array of frames.

Whether or not the frame is an integer.

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

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.

Attempt to parse the frame as a cluster redirection.

Attempt to read the number of bytes needed to encode this frame.

Trait Implementations

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

Formats the value using the given formatter. Read more

Converts to this type from the input type.

Converts to this type from the input type.

This method tests for self and other values to be equal, and is used by ==. Read more

This method tests for !=.

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

The resulting type after obtaining ownership.

Creates owned data from borrowed data, usually by cloning. Read more

Uses borrowed data to replace owned data, usually by cloning. Read more

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.