Safe wrapper for the [Discord Game SDK]
This crate is not official, it is not supported by the Discord Game SDK Developers.
This crate provides Rust support to the following Discord features:
https://docs.rs/discord_game_sdk
https://crates.io/crates/discord_game_sdk
Add this to your Cargo.toml
:
toml
[dependencies]
discord_game_sdk = "0.5.0-alpha.1"
Set the following environment variable:
sh
export DISCORD_GAME_SDK_PATH=/path/to/discord_game_sdk
Ensure that appropriately named dynamic libraries are available when launching the program:
On Linux and OS X, the dynamic library must be renamed to libdiscord_game_sdk.so
or
libdiscord_game_sdk.dylib
.
(TODO: ^ might be unnecessary, how to set the rpath in the output binary)
This library is currently in early stages but is stabilizing. It is usable. I'm not aware of any good ways to test this crate, there are currently no tests.
link
: (enabled by default, delegates to discord_game_sdk_sys/link
)
Provides the linker with an appropriately named dynamic library.
This allows for cargo run
to run flawlessly on Linux.This crate relies on the SDK to provide correct data and behavior:
- Non-null pointers to valid memory
- UTF-8, NUL-terminated strings
- Valid enum values
- No mutation of memory it should have no ownership of
- No use of pointers after destroy
is called
You MUST acquaint yourself with and agree to the [official terms of the Discord Game SDK].
The code of the Rust crates discord_game_sdk
and discord_game_sdk_sys
are licensed under
either of:
at your option.
I can be reached via Discord twiikuu#0047
, on the [Official Game SDK Server] (nicked as
ldesgoui (rust wrapper)
, as well as [twitter] and [email].
I reserve myself no obligation to support you, although I'm generally nice.