pub struct SqlWarning {
pub code: u16,
pub level: SqlWarningLevel,
pub message: String,
}Expand description
A SQL warning returned by the database server after a statement.
Obtain a Vec<SqlWarning> by calling
Connection::last_warnings immediately
after an execute or query call. The list is cleared before each
statement and repopulated afterwards (backends that support warnings).
§Example
use oxisql_core::{SqlWarning, SqlWarningLevel};
let w = SqlWarning {
code: 1292,
level: SqlWarningLevel::Warning,
message: "Incorrect date value: '2024-13-01'".to_string(),
};
assert!(w.to_string().contains("1292"));
assert!(w.to_string().contains("Warning"));Fields§
§code: u16MySQL server error/warning code (e.g. 1292 for ER_TRUNCATED_WRONG_VALUE).
level: SqlWarningLevelSeverity level of the warning.
message: StringHuman-readable message from the server.
Trait Implementations§
Source§impl Clone for SqlWarning
impl Clone for SqlWarning
Source§fn clone(&self) -> SqlWarning
fn clone(&self) -> SqlWarning
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · 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 SqlWarning
impl Debug for SqlWarning
Source§impl Display for SqlWarning
impl Display for SqlWarning
impl Eq for SqlWarning
Source§impl PartialEq for SqlWarning
impl PartialEq for SqlWarning
Source§fn eq(&self, other: &SqlWarning) -> bool
fn eq(&self, other: &SqlWarning) -> bool
Tests for
self and other values to be equal, and is used by ==.impl StructuralPartialEq for SqlWarning
Auto Trait Implementations§
impl Freeze for SqlWarning
impl RefUnwindSafe for SqlWarning
impl Send for SqlWarning
impl Sync for SqlWarning
impl Unpin for SqlWarning
impl UnsafeUnpin for SqlWarning
impl UnwindSafe for SqlWarning
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