Trait windows_helpers::core::CheckNumberError
source · pub trait CheckNumberError{
// Required methods
fn nonzero_with_win32_or_err(self) -> Result<Self>;
fn nonzero_or_win32_err(self) -> Result<Self>;
fn nonzero_or_e_fail(self) -> Result<Self>;
}Required Methods§
sourcefn nonzero_with_win32_or_err(self) -> Result<Self>
fn nonzero_with_win32_or_err(self) -> Result<Self>
Passes a non-zero self through to an Ok value, or, in case of it being zero, returns Err with [windows::core::Error::from_win32()], if it yields an error code, or Ok(0) otherwise.
To be used with functions that communicate valid values as well as errors by a return value of 0 and need an additional call to GetLastError() to check whether an error has occurred (e.g., SetWindowLongPtrW()). Note that, depending on whether the function calls SetLastError() under all circumstances, you may need to precede the call for which you call this function by SetLastError(ERROR_SUCCESS).
sourcefn nonzero_or_win32_err(self) -> Result<Self>
fn nonzero_or_win32_err(self) -> Result<Self>
Passes a non-zero self through to an Ok value, or, in case of it being zero, returns Err with [windows::core::Error::from_win32()].
sourcefn nonzero_or_e_fail(self) -> Result<Self>
fn nonzero_or_e_fail(self) -> Result<Self>
Object Safety§
This trait is not object safe.