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>
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.