#[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 for ResResultBody
impl PartialEq 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 ==
.source§impl Serialize for ResResultBody
impl Serialize for ResResultBody
impl Eq for ResResultBody
impl StructuralPartialEq for ResResultBody
Auto Trait Implementations§
impl Freeze for ResResultBody
impl RefUnwindSafe for ResResultBody
impl Send for ResResultBody
impl Sync for ResResultBody
impl Unpin for ResResultBody
impl UnwindSafe for ResResultBody
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
source§impl<T> IntoEither for T
impl<T> IntoEither for T
source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moresource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more