simconnect-sdk 0.2.1

SimConnect SDK. An opinionated SimConnect Client that encapsulates the C API fully and optimizes for developer experience.
Documentation
macro_rules! success {
    ($hr:expr) => {{
        let hr = $hr;
        if hr == 0 {
            Ok(())
        } else {
            Err(SimConnectError::SimConnectError(hr))
        }
    }};
}
pub(crate) use success;

macro_rules! ok_if_fail {
    ($hr:expr, $ret:expr) => {{
        let hr = $hr;
        let ret = $ret;
        if hr != 0 {
            return Ok(ret);
        }
    }};
}
pub(crate) use ok_if_fail;

macro_rules! as_c_string {
    ($target:expr) => {
        std::ffi::CString::new($target)
            .map_err(|_| SimConnectError::UnexpectedError("failed to create CString".to_string()))?
            .as_ptr()
    };
}
pub(crate) use as_c_string;