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>>
It 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>
It returns Some
rows metadata if frame 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 more
sourceimpl Debug for ResResultBody
impl Debug for ResResultBody
sourceimpl Hash for ResResultBody
impl Hash for ResResultBody
sourceimpl Ord for ResResultBody
impl Ord for ResResultBody
sourceimpl PartialEq<ResResultBody> for ResResultBody
impl PartialEq<ResResultBody> for ResResultBody
sourcefn 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 ==
. Read more
sourcefn ne(&self, other: &ResResultBody) -> bool
fn ne(&self, other: &ResResultBody) -> bool
This method tests for !=
.
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>
This method returns an ordering between self
and other
values if one exists. Read more
1.0.0 · sourcefn lt(&self, other: &Rhs) -> bool
fn lt(&self, other: &Rhs) -> bool
This method tests less than (for self
and other
) and is used by the <
operator. Read more
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 more
sourceimpl 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 T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
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
sourceimpl<T> ToOwned for T where
T: Clone,
impl<T> ToOwned for T where
T: Clone,
type Owned = T
type Owned = T
The resulting type after obtaining ownership.
sourcefn clone_into(&self, target: &mut T)
fn clone_into(&self, target: &mut T)
toowned_clone_into
)Uses borrowed data to replace owned data, usually by cloning. Read more