aboutsummaryrefslogtreecommitdiff
path: root/src/user.rs
diff options
context:
space:
mode:
authorMatthew Collins <[email protected]>2018-02-27 12:18:56 +0000
committerMatthew Collins <[email protected]>2018-02-27 12:18:56 +0000
commitdb7c3f7bcd5f1e804345bf90591f3e360ef456fb (patch)
tree621b19bddf5078ef8c5d763575eeb6745888cb64 /src/user.rs
parentDerive `Ord`/`Eq` for SteamId (diff)
downloadsteamworks-rs-db7c3f7bcd5f1e804345bf90591f3e360ef456fb.tar.xz
steamworks-rs-db7c3f7bcd5f1e804345bf90591f3e360ef456fb.zip
Add basic steam user accessor
Diffstat (limited to 'src/user.rs')
-rw-r--r--src/user.rs17
1 files changed, 17 insertions, 0 deletions
diff --git a/src/user.rs b/src/user.rs
new file mode 100644
index 0000000..fcd3e40
--- /dev/null
+++ b/src/user.rs
@@ -0,0 +1,17 @@
+
+use super::*;
+
+/// Access to the steam user interface
+pub struct User {
+ pub(crate) user: *mut sys::ISteamUser,
+ pub(crate) _client: Arc<ClientInner>,
+}
+
+impl User {
+ /// Returns the steam id of the current user
+ pub fn steam_id(&self) -> SteamId {
+ unsafe {
+ SteamId(sys::SteamAPI_ISteamUser_GetSteamID(self.user))
+ }
+ }
+} \ No newline at end of file