#[non_exhaustive]pub enum ProtocolError {
UnexpectedResponse(CqlResponseKind),
PreparedStatementIdsMismatch,
RepreparedIdChanged {
statement: String,
expected_id: Vec<u8>,
reprepared_id: Vec<u8>,
},
UseKeyspace(UseKeyspaceProtocolError),
SchemaVersionFetch(SchemaVersionFetchError),
NonfinishedPagingState,
InvalidCqlType {
typ: String,
position: usize,
reason: String,
},
PartitionKeyExtraction,
Tracing(TracingProtocolError),
RepreparedIdMissingInBatch,
}
Expand description
A protocol error.
It indicates an inconsistency between CQL protocol and server’s behavior. In some cases, it could also represent a misuse of internal driver API - a driver bug.
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.
UnexpectedResponse(CqlResponseKind)
Received an unexpected response when RESULT or ERROR was expected.
PreparedStatementIdsMismatch
Prepared statement id mismatch.
RepreparedIdChanged
Prepared statement id changed after repreparation.
UseKeyspace(UseKeyspaceProtocolError)
USE KEYSPACE protocol error.
SchemaVersionFetch(SchemaVersionFetchError)
A protocol error appeared during schema version fetch.
NonfinishedPagingState
A result with nonfinished paging state received for unpaged query.
InvalidCqlType
Failed to parse CQL type.
PartitionKeyExtraction
Unable extract a partition key based on prepared statement’s metadata.
Tracing(TracingProtocolError)
A protocol error occurred during tracing info fetch.
RepreparedIdMissingInBatch
Driver tried to reprepare a statement in the batch, but the reprepared statement’s id is not included in the batch.
Trait Implementations§
Source§impl Clone for ProtocolError
impl Clone for ProtocolError
Source§fn clone(&self) -> ProtocolError
fn clone(&self) -> ProtocolError
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 ProtocolError
impl Debug for ProtocolError
Source§impl Display for ProtocolError
impl Display for ProtocolError
Source§impl Error for ProtocolError
impl Error for ProtocolError
Source§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
Returns the lower-level source of this error, if any. Read more
1.0.0 · Source§fn description(&self) -> &str
fn description(&self) -> &str
👎Deprecated since 1.42.0: use the Display impl or to_string()
Source§impl From<ProtocolError> for NewSessionError
impl From<ProtocolError> for NewSessionError
Source§fn from(source: ProtocolError) -> Self
fn from(source: ProtocolError) -> Self
Converts to this type from the input type.
Source§impl From<ProtocolError> for QueryError
impl From<ProtocolError> for QueryError
Source§fn from(source: ProtocolError) -> Self
fn from(source: ProtocolError) -> Self
Converts to this type from the input type.
Source§impl From<SchemaVersionFetchError> for ProtocolError
impl From<SchemaVersionFetchError> for ProtocolError
Source§fn from(source: SchemaVersionFetchError) -> Self
fn from(source: SchemaVersionFetchError) -> Self
Converts to this type from the input type.
Source§impl From<TracingProtocolError> for ProtocolError
impl From<TracingProtocolError> for ProtocolError
Source§fn from(source: TracingProtocolError) -> Self
fn from(source: TracingProtocolError) -> Self
Converts to this type from the input type.
Source§impl From<UseKeyspaceProtocolError> for ProtocolError
impl From<UseKeyspaceProtocolError> for ProtocolError
Source§fn from(source: UseKeyspaceProtocolError) -> Self
fn from(source: UseKeyspaceProtocolError) -> Self
Converts to this type from the input type.
Auto Trait Implementations§
impl !Freeze for ProtocolError
impl !RefUnwindSafe for ProtocolError
impl Send for ProtocolError
impl Sync for ProtocolError
impl Unpin for ProtocolError
impl !UnwindSafe for ProtocolError
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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
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