pub struct Win32Error(/* private fields */);Expand description
A WIN32_ERROR wrapper.
Implementations§
Source§impl Win32Error
impl Win32Error
Sourcepub fn is_ok(self) -> bool
pub fn is_ok(self) -> bool
Tells whether the error is ERROR_SUCCESS.
Sourcepub fn is_err(self) -> bool
pub fn is_err(self) -> bool
Tells whether the error is not ERROR_SUCCESS.
Sourcepub fn code_number(self) -> u32
pub fn code_number(self) -> u32
The numeric error code.
§Example
use windows_ccd::Win32Error;
use windows_ccd::windows::ERROR_INVALID_PARAMETER;
let e = Win32Error::from(ERROR_INVALID_PARAMETER);
assert_eq!(e.code_number(), 87);Sourcepub fn code_str_and_text(self) -> Option<(&'static str, &'static str)>
pub fn code_str_and_text(self) -> Option<(&'static str, &'static str)>
The name and description of the error.
§Example
use windows_ccd::Win32Error;
use windows_ccd::windows::ERROR_INVALID_PARAMETER;
let e = Win32Error::from(ERROR_INVALID_PARAMETER);
let (error_code_str, error_text) = e.code_str_and_text().unwrap();
assert_eq!(error_code_str, "ERROR_INVALID_PARAMETER");
assert_eq!(error_text, "The combination of parameters and flags that are specified is invalid.");Trait Implementations§
Source§impl Clone for Win32Error
impl Clone for Win32Error
Source§fn clone(&self) -> Win32Error
fn clone(&self) -> Win32Error
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 Win32Error
impl Debug for Win32Error
Source§impl Display for Win32Error
impl Display for Win32Error
Source§impl From<WIN32_ERROR> for Win32Error
impl From<WIN32_ERROR> for Win32Error
Source§fn from(value: WIN32_ERROR) -> Self
fn from(value: WIN32_ERROR) -> Self
Converts to this type from the input type.
Source§impl From<i32> for Win32Error
impl From<i32> for Win32Error
Source§impl From<u32> for Win32Error
impl From<u32> for Win32Error
Source§impl PartialEq for Win32Error
impl PartialEq for Win32Error
Source§fn eq(&self, other: &Win32Error) -> bool
fn eq(&self, other: &Win32Error) -> bool
Tests for
self and other values to be equal, and is used by ==.impl Copy for Win32Error
impl Eq for Win32Error
impl StructuralPartialEq for Win32Error
Auto Trait Implementations§
impl Freeze for Win32Error
impl RefUnwindSafe for Win32Error
impl Send for Win32Error
impl Sync for Win32Error
impl Unpin for Win32Error
impl UnsafeUnpin for Win32Error
impl UnwindSafe for Win32Error
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
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
Compare self to
key and return true if they are equal.