Enum ResponseBody

Source
pub enum ResponseBody {
Show 16 variants Error(CDRSError), Startup, Ready(BodyResResultVoid), Authenticate(BodyResAuthenticate), Options, Supported(BodyResSupported), Query, Result(ResResultBody), Prepare, Execute, Register, Event(BodyResEvent), Batch, AuthChallenge(BodyResAuthChallenge), AuthResponse, AuthSuccess(BodyReqAuthSuccess),
}

Variants§

§

Error(CDRSError)

§

Startup

§

Ready(BodyResResultVoid)

§

Authenticate(BodyResAuthenticate)

§

Options

§

Supported(BodyResSupported)

§

Query

§

Result(ResResultBody)

§

Prepare

§

Execute

§

Register

§

Event(BodyResEvent)

§

Batch

§

AuthChallenge(BodyResAuthChallenge)

§

AuthResponse

§

AuthSuccess(BodyReqAuthSuccess)

Implementations§

Source§

impl ResponseBody

Source

pub fn from(bytes: &[u8], response_type: &Opcode) -> Result<ResponseBody>

Source

pub fn into_rows(self) -> Option<Vec<Row>>

Source

pub fn as_rows_metadata(&self) -> Option<RowsMetadata>

Source

pub fn as_cols(&self) -> Option<&BodyResResultRows>

Source

pub fn into_prepared(self) -> Option<BodyResResultPrepared>

It unwraps body and returns BodyResResultPrepared which contains an exact result of PREPARE query. If frame body is not of type Result this method returns None.

Source

pub fn into_set_keyspace(self) -> Option<BodyResResultSetKeyspace>

It unwraps body and returns BodyResResultPrepared which contains an exact result of use keyspace query. If frame body is not of type Result this method returns None.

Source

pub fn into_server_event(self) -> Option<BodyResEvent>

It unwraps body and returns BodyResEvent. If frame body is not of type Result this method returns None.

Source

pub fn get_authenticator<'a>(&'a self) -> Option<&'a str>

Trait Implementations§

Source§

impl Debug for ResponseBody

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.