#[non_exhaustive]
pub enum ResResultBody {
Void,
Rows(BodyResResultRows),
SetKeyspace(BodyResResultSetKeyspace),
Prepared(BodyResResultPrepared),
SchemaChange(SchemaChange),
}
Expand description
ResponseBody
is a generalized enum that represents all types of responses. Each of enum
option wraps related body type.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.
Void
Void response body. It’s an empty struct.
Rows(BodyResResultRows)
Rows response body. It represents a body of response which contains rows.
SetKeyspace(BodyResResultSetKeyspace)
Set keyspace body. It represents a body of set_keyspace query and usually contains a name of just set namespace.
Prepared(BodyResResultPrepared)
Prepared response body.
SchemaChange(SchemaChange)
Schema change body
Implementations§
source§impl ResResultBody
impl ResResultBody
sourcepub fn into_rows(self) -> Option<Vec<Row>>
pub fn into_rows(self) -> Option<Vec<Row>>
Converts body into Vec<Row>
if body’s type is Row
and returns None
otherwise.
sourcepub fn as_rows_metadata(&self) -> Option<&RowsMetadata>
pub fn as_rows_metadata(&self) -> Option<&RowsMetadata>
Returns Some
rows metadata if envelope result is of type rows and None
otherwise
sourcepub fn into_prepared(self) -> Option<BodyResResultPrepared>
pub fn into_prepared(self) -> Option<BodyResResultPrepared>
Unwraps body and returns BodyResResultPrepared which contains an exact result of PREPARE query.
sourcepub fn into_set_keyspace(self) -> Option<BodyResResultSetKeyspace>
pub fn into_set_keyspace(self) -> Option<BodyResResultSetKeyspace>
Unwraps body and returns BodyResResultSetKeyspace which contains an exact result of use keyspace query.
source§impl ResResultBody
impl ResResultBody
pub fn from_cursor( cursor: &mut Cursor<&[u8]>, version: Version ) -> Result<ResResultBody>
Trait Implementations§
source§impl Clone for ResResultBody
impl Clone for ResResultBody
source§fn clone(&self) -> ResResultBody
fn clone(&self) -> ResResultBody
Returns a copy of the value. Read more
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moresource§impl Debug for ResResultBody
impl Debug for ResResultBody
source§impl Hash for ResResultBody
impl Hash for ResResultBody
source§impl PartialEq<ResResultBody> for ResResultBody
impl PartialEq<ResResultBody> for ResResultBody
source§fn eq(&self, other: &ResResultBody) -> bool
fn eq(&self, other: &ResResultBody) -> bool
This method tests for
self
and other
values to be equal, and is used
by ==
.