pub enum ValidationError {
StructNotRegistered {
struct_name: String,
},
TablesNotRegistered {
tables: Vec<String>,
},
MissingColumns {
struct_name: String,
missing: Vec<String>,
},
UnknownColumn {
column: String,
},
SqlSyntaxError {
message: String,
},
HyperError {
message: String,
},
}Expand description
The result of validating one query_as! / query_scalar! invocation.
Variants§
StructNotRegistered
The struct used in query_as! has not been registered via
#[derive(Table)] #[hyperdb(register)].
TablesNotRegistered
One or more tables referenced by the SQL are not in the registry.
MissingColumns
The query’s result schema is missing columns that the target struct requires (one entry per missing column name).
Fields
UnknownColumn
The SQL references a column that does not exist on any table in the
query (SQLSTATE 42703). Distinct from MissingColumns, which is when
the query is valid but omits a column the struct needs.
SqlSyntaxError
The SQL has a syntax error; the message is forwarded verbatim from Hyper.
HyperError
An unexpected Hyper error occurred during dry-run.
Implementations§
Source§impl ValidationError
impl ValidationError
Sourcepub fn to_diagnostic(&self) -> String
pub fn to_diagnostic(&self) -> String
Human-readable diagnostic message suitable for embedding in
compile_error!("...").
Trait Implementations§
Source§impl Clone for ValidationError
impl Clone for ValidationError
Source§fn clone(&self) -> ValidationError
fn clone(&self) -> ValidationError
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for ValidationError
impl Debug for ValidationError
Source§impl Display for ValidationError
impl Display for ValidationError
Source§impl Error for ValidationError
impl Error for ValidationError
1.30.0 · Source§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
1.0.0 · Source§fn description(&self) -> &str
fn description(&self) -> &str
use the Display impl or to_string()
Source§impl PartialEq for ValidationError
impl PartialEq for ValidationError
Source§fn eq(&self, other: &ValidationError) -> bool
fn eq(&self, other: &ValidationError) -> bool
self and other values to be equal, and is used by ==.impl Eq for ValidationError
impl StructuralPartialEq for ValidationError
Auto Trait Implementations§
impl Freeze for ValidationError
impl RefUnwindSafe for ValidationError
impl Send for ValidationError
impl Sync for ValidationError
impl Unpin for ValidationError
impl UnsafeUnpin for ValidationError
impl UnwindSafe for ValidationError
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.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> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
Source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
T in a tonic::Request