pub enum SqlResult<T> {
Success(T),
SuccessWithInfo(T),
Error {
function: &'static str,
},
}
Expand description
Result of an ODBC function call. Variants hold the same meaning as the constants associated with
SqlReturn
. This type may hold results, but it is still the responsibility of the user to
fetch and handle the diagnostics in case of an Error.
Variants
Success(T)
The function has been executed successfully.
SuccessWithInfo(T)
The function has been executed successfully. There have been warnings.
Error
Fields
function: &'static str
Name of the ODBC Api call which caused the error. This might help interpreting associatedif the error ODBC diagnostics if the error is bubbeld all the way up to the end users output, but the context is lost.
Function returned error state. Check diagnostics.
Implementations
sourceimpl<T> SqlResult<T>
impl<T> SqlResult<T>
sourcepub fn into_result(self, handle: &impl Diagnostics) -> Result<T, Error>
pub fn into_result(self, handle: &impl Diagnostics) -> Result<T, Error>
Self::Success
and Self::SuccessWithInfo
are mapped to Ok. In case of
Self::SuccessWithInfo
any diagnostics are logged. Self::Error
is mapped to error.
sourcepub fn into_result_with_trunaction_check(
self,
handle: &impl Diagnostics,
error_for_truncation: bool
) -> Result<T, Error>
pub fn into_result_with_trunaction_check(
self,
handle: &impl Diagnostics,
error_for_truncation: bool
) -> Result<T, Error>
Intended to be used to be used after bulk fetching into a buffer. Mostly the same as
Self::into_result
, but if error_for_truncation
is true
any diagnostics are inspected
for truncation. If any truncation is found an error is returned.
Trait Implementations
Auto Trait Implementations
impl<T> RefUnwindSafe for SqlResult<T> where
T: RefUnwindSafe,
impl<T> Send for SqlResult<T> where
T: Send,
impl<T> Sync for SqlResult<T> where
T: Sync,
impl<T> Unpin for SqlResult<T> where
T: Unpin,
impl<T> UnwindSafe for SqlResult<T> where
T: UnwindSafe,
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more