pub trait ResultExt<T> {
    // Required methods
    fn from_nonzero_or_win32(t: T) -> Result<T>
       where T: Zero;
    fn from_checked_or_win32<F>(t: T, check: F) -> Result<T>
       where F: FnOnce(&T) -> bool;
}

Required Methods§

source

fn from_nonzero_or_win32(t: T) -> Result<T>
where T: Zero,

Passes a non-zero T through to an Ok value, or, in case of it being zero, returns Err with [windows::core::Error::from_win32()].

source

fn from_checked_or_win32<F>(t: T, check: F) -> Result<T>
where F: FnOnce(&T) -> bool,

Passes a T through to an Ok value, if the check is successful, or otherwise returns Err with [windows::core::Error::from_win32()].

Object Safety§

This trait is not object safe.

Implementations on Foreign Types§

source§

impl<T> ResultExt<T> for Result<T>

source§

fn from_nonzero_or_win32(t: T) -> Result<T>
where T: Zero,

source§

fn from_checked_or_win32<F>(t: T, check: F) -> Result<T>
where F: FnOnce(&T) -> bool,

Implementors§