Expand description
§eos-rs
Safe(ish) Rust wrappers around the Epic Online Services (EOS) C SDK.
This crate is designed as an ergonomic layer over eos_sys, while still
allowing escape hatches to raw handles for APIs that are not yet wrapped.
§Chapter 1: Installation
Add dependency:
[dependencies]
eos-rs = "0.1"Provide EOS SDK location when building:
EOS_SDK_DIR=/path/to/EOS-SDK
Expected layout inside EOS_SDK_DIR:
Include/Lib/
On Windows, ship EOSSDK-Win64-Shipping.dll with your app.
§Chapter 2: SDK Lifecycle
EOS has a global lifecycle:
initialize- Create a
Platform - Call
Platform::tickregularly - Drop
Platform shutdown
§Chapter 3: Quick Start
use eos_rs::{initialize, shutdown, InitializeOptions, Platform, PlatformOptions};
fn main() -> Result<(), Box<dyn std::error::Error>> {
initialize(InitializeOptions {
product_name: "my-game".to_string(),
product_version: "0.1.0".to_string(),
})?;
let platform = Platform::create(PlatformOptions {
product_id: "product-id".to_string(),
sandbox_id: "sandbox-id".to_string(),
deployment_id: "deployment-id".to_string(),
client_id: "client-id".to_string(),
client_secret: "client-secret".to_string(),
is_server: false,
encryption_key: None,
override_country_code: None,
override_locale_code: None,
})?;
// Call once per frame/tick in your game loop.
platform.tick();
drop(platform);
shutdown()?;
Ok(())
}§Chapter 4: Interfaces and Raw Escape Hatch
Platform exposes typed accessors for EOS interfaces (auth(), connect(),
lobby(), p2p(), and more). Each wrapper provides raw_handle() so you can
call any function from sys directly when needed.
§Chapter 5: Callback Model
EOS async APIs are callback-based. eos-rs wraps selected callbacks with Rust
closures and owns callback context allocations until EOS invokes them.
§Chapter 6: Owned EOS Objects
EOS returns many heap/handle values that require *_Release. This crate defines
RAII wrappers for those objects; dropping the wrapper calls the matching release
API automatically.
§Chapter 7: Safety Notes
This crate significantly improves safety over raw FFI, but it is not fully safe:
- EOS threading requirements still apply.
- EOS callback contracts still apply.
raw_handle()access can bypass invariants.
Prefer wrapped methods and RAII types where available.
Re-exports§
pub use eos_sys as sys;
Structs§
- Achievements
- Achievements
Definition - Achievements
Definition V2 - Achievements
Player Achievement - Achievements
Unlocked Achievement - Active
Session - Active
Session Info - Anti
Cheat Client - Anti
Cheat Server - Auth
- Auth
IdToken - Auth
Token - Best
Display Name - Connect
- Connect
External Account Info - Connect
IdToken - Continuance
Token - Create
Lobby Params - Custom
Invites - Ecom
- Ecom
Catalog Item - Ecom
Catalog Offer - Ecom
Catalog Release - Ecom
Entitlement - Ecom
KeyImage Info - Ecom
Transaction - Epic
Account Id - External
User Info - Friends
- Initialize
Options - Integrated
Platform - Kws
- KwsPermission
Status - Leaderboards
- Leaderboards
Definition - Leaderboards
Leaderboard Definition - Leaderboards
Record - Leaderboards
User Score - Lobby
- Lobby
Attribute - Lobby
Details - Lobby
Details Info - Lobby
Member Info - Lobby
Modification - Lobby
Search - Metrics
- Mods
- Mods
ModInfo - P2P
- Packet
Queue Info - Platform
- Platform
Options - Player
Data Storage - Player
Data Storage File Metadata - Player
Data Storage File Transfer Request - Presence
- Presence
Info - Presence
Modification - Product
User Id - Progression
Snapshot - Received
Packet - Reports
- Rtc
- RtcAdmin
- RtcAdmin
User Token - Sanctions
- Sanctions
Player Sanction - Session
Details - Session
Details Attribute - Session
Details Info - Session
Modification - Session
Search - Sessions
- Stats
- Stats
Stat - Title
Storage - Title
Storage File Metadata - Title
Storage File Transfer Request - Ui
- User
Info - User
Info Data