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
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
sourceimpl 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.
sourceimpl ResResultBody
impl ResResultBody
pub fn from_cursor(
cursor: &mut Cursor<&[u8]>,
version: Version
) -> Result<ResResultBody>
Trait Implementations
sourceimpl Clone for ResResultBody
impl Clone for ResResultBody
sourcefn clone(&self) -> ResResultBody
fn clone(&self) -> ResResultBody
Returns a copy of the value. Read more
1.0.0 · sourcefn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moresourceimpl Debug for ResResultBody
impl Debug for ResResultBody
sourceimpl Hash for ResResultBody
impl Hash for ResResultBody
sourceimpl Ord for ResResultBody
impl Ord for ResResultBody
sourcefn cmp(&self, other: &ResResultBody) -> Ordering
fn cmp(&self, other: &ResResultBody) -> Ordering
1.21.0 · sourcefn max(self, other: Self) -> Self
fn max(self, other: Self) -> Self
Compares and returns the maximum of two values. Read more
1.21.0 · sourcefn min(self, other: Self) -> Self
fn min(self, other: Self) -> Self
Compares and returns the minimum of two values. Read more
1.50.0 · sourcefn clamp(self, min: Self, max: Self) -> Selfwhere
Self: PartialOrd<Self>,
fn clamp(self, min: Self, max: Self) -> Selfwhere
Self: PartialOrd<Self>,
Restrict a value to a certain interval. Read more
sourceimpl PartialEq<ResResultBody> for ResResultBody
impl PartialEq<ResResultBody> for ResResultBody
sourcefn eq(&self, other: &ResResultBody) -> bool
fn eq(&self, other: &ResResultBody) -> bool
sourceimpl PartialOrd<ResResultBody> for ResResultBody
impl PartialOrd<ResResultBody> for ResResultBody
sourcefn partial_cmp(&self, other: &ResResultBody) -> Option<Ordering>
fn partial_cmp(&self, other: &ResResultBody) -> Option<Ordering>
1.0.0 · sourcefn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
This method tests less than or equal to (for
self
and other
) and is used by the <=
operator. Read moresourceimpl Serialize for ResResultBody
impl Serialize for ResResultBody
impl Eq for ResResultBody
impl StructuralEq for ResResultBody
impl StructuralPartialEq for ResResultBody
Auto Trait Implementations
impl RefUnwindSafe for ResResultBody
impl Send for ResResultBody
impl Sync for ResResultBody
impl Unpin for ResResultBody
impl UnwindSafe for ResResultBody
Blanket Implementations
sourceimpl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more