pub enum ResResultBody {
Void(BodyResResultVoid),
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(BodyResResultVoid)
Void response body. It’s an empty stuct.
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>>
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 othewise
Sourcepub fn into_prepared(self) -> Option<BodyResResultPrepared>
pub fn into_prepared(self) -> Option<BodyResResultPrepared>
It 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>
It unwraps body and returns BodyResResultSetKeyspace which contains an exact result of use keyspace query.
Trait Implementations§
Source§impl Debug for ResResultBody
impl Debug for ResResultBody
Source§impl FromCursor for ResResultBody
impl FromCursor for ResResultBody
Source§fn from_cursor(cursor: &mut Cursor<&[u8]>) -> Result<ResResultBody>
fn from_cursor(cursor: &mut Cursor<&[u8]>) -> Result<ResResultBody>
It should return an implementor from an
io::Cursor over an array of bytes.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