[−][src]Struct w32_error::W32Error
A Windows API error.
Methods
impl W32Error
[src]
pub const fn new(code: DWORD) -> Self
[src]
pub fn from_io_error(other: &Error) -> Option<Self>
[src]
Wraps the error code from an io::Error
if it has one.
Examples
use std::io; let io_error = io::Error::from_raw_os_error(0); let opt = W32Error::from_io_error(&io_error); assert_eq!(opt, Some(W32Error::new(0)));
pub fn last_thread_error() -> Self
[src]
Wraps the error code that is currently set for the calling thread.
This is equivalent to calling the Windows API function GetLastError
and passing the return
value to W32Error::new
.
Examples
let error = W32Error::last_thread_error(); println!("{}", error);
pub const fn into_inner(self) -> DWORD
[src]
Returns the underlying error code wrapped by a W32Error
.
Examples
assert_eq!(W32Error::new(0).into_inner(), 0);
Trait Implementations
impl Clone for W32Error
[src]
impl Copy for W32Error
[src]
impl Debug for W32Error
[src]
impl Display for W32Error
[src]
impl Eq for W32Error
[src]
impl Error for W32Error
[src]
fn source(&self) -> Option<&(dyn Error + 'static)>
1.30.0[src]
fn backtrace(&self) -> Option<&Backtrace>
[src]
fn description(&self) -> &str
1.0.0[src]
fn cause(&self) -> Option<&dyn Error>
1.0.0[src]
impl From<W32Error> for Error
[src]
impl From<W32Error> for DWORD
[src]
impl From<u32> for W32Error
[src]
impl Hash for W32Error
[src]
fn hash<__H: Hasher>(&self, state: &mut __H)
[src]
fn hash_slice<H>(data: &[Self], state: &mut H) where
H: Hasher,
1.3.0[src]
H: Hasher,
impl Ord for W32Error
[src]
fn cmp(&self, other: &W32Error) -> Ordering
[src]
#[must_use]fn max(self, other: Self) -> Self
1.21.0[src]
#[must_use]fn min(self, other: Self) -> Self
1.21.0[src]
#[must_use]fn clamp(self, min: Self, max: Self) -> Self
[src]
impl PartialEq<W32Error> for W32Error
[src]
impl PartialOrd<W32Error> for W32Error
[src]
fn partial_cmp(&self, other: &W32Error) -> Option<Ordering>
[src]
fn lt(&self, other: &W32Error) -> bool
[src]
fn le(&self, other: &W32Error) -> bool
[src]
fn gt(&self, other: &W32Error) -> bool
[src]
fn ge(&self, other: &W32Error) -> bool
[src]
impl StructuralEq for W32Error
[src]
impl StructuralPartialEq for W32Error
[src]
impl TryFrom<Error> for W32Error
[src]
Auto Trait Implementations
impl RefUnwindSafe for W32Error
impl Send for W32Error
impl Sync for W32Error
impl Unpin for W32Error
impl UnwindSafe for W32Error
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
fn to_owned(&self) -> T
[src]
fn clone_into(&self, target: &mut T)
[src]
impl<T> ToString for T where
T: Display + ?Sized,
[src]
T: Display + ?Sized,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,