Awesome
gqlmapi-rs
The C++ portion of this crate is based on Electron-GqlMAPI. Unlike that project, there is no V8 engine or Node interoperability/threading requirement. I wrote just enough support code and state management for that API projection though, that I decided to use it as the basis for an API projection to Rust.
The next layer in the Electron stack is
eMAPI. The corresponding next layer in this stack is a
Tauri app called Tauri GqlMAPI that
does the same thing but in a much more lightweight fashion than Electron
.
Getting Started
This project only builds on Windows, and I've only tested it with x64 builds. It requires that you have CMake and vcpkg installed, the versions included with Visual Studio 2022 work fine.
You will need to set an environment variable to tell build.rs where to find it, or install the
user-wide vcpkg integration before building this crate. In this example, I have vcpkg
in a subdirectory
called source\repos\microsoft\vcpkg
under my user profile, and I'm targetting x64-windows-static
, so I
don't need to copy any DLLs from vcpkg:
> set VCPKG_ROOT=%USERPROFILE%\source\repos\microsoft\vcpkg
or:
> vcpkg integrate install
The build.rs
script determines the target x64-windows
or x86-windows
platform based on the Rust target,
and if you enable the crt-static
target feature feature, it also uses the -static
triplet. Hint: If you
would rather not redistribute DLLs for gqlmapi
and cppgraphqlgen
with your app, try adding this to the
.cargo/config.toml
file in your project:
[target.x86_64-pc-windows-msvc]
rustflags = ["-C", "target-feature=+crt-static"]
Make sure you have also cloned the gqlmapi
sub-module. If you did not clone this repo recursively, you
can still pull down the sub-module with a couple of git commands:
> git submodule init
> git submodule update
After that, you should be ready to build with cargo build
.
Dependencies
- Microsoft Outlook for runtime MAPI support
- gqlmapi for the C++ GraphQL bindings to MAPI
- vcpkg package manager for the GqlMAPI C++ dependencies
- cmake crate to automatically build gqlmapi
- cxx crate to generate the C++ bindings