pub struct Friends<'a> { /* private fields */ }Expand description
The friends accessor, borrowed from the client for one call.
Build it with crate::ArcaneClient::friends; it holds no state of its own,
so keeping one around buys nothing.
Implementations§
Source§impl<'a> Friends<'a>
impl<'a> Friends<'a>
Sourcepub fn list(&self) -> Result<FriendList, SdkError>
pub fn list(&self) -> Result<FriendList, SdkError>
This player’s friends, each with online and in_game.
One synchronous loopback round trip. The Arcane desktop app caches the
list for 15 seconds and sets FriendList::stale when it served an
older copy while offline, so calling this on a menu or a timer of a few
seconds is fine — calling it per frame is not.
§Errors
not_authenticated when nobody is signed in, network_required under
ARCANE_OFFLINE_ONLY (raised before any call), arcane_unavailable when
the desktop app is not running, feature_unavailable when it predates
the route.
Sourcepub fn send_request(&self, user_id: &str) -> Result<(), SdkError>
pub fn send_request(&self, user_id: &str) -> Result<(), SdkError>
Ask another player to be friends on Arcane — typically someone met in
a lobby, whose id is crate::LobbyMember::user_id.
The request shows up in their launcher, where they accept or decline it. One synchronous loopback round trip.
§Errors
invalid_argument for a malformed id or for this player’s own id
(raised before any call), user_not_found, already_friends when you
are friends or a request is already pending either way, plus the codes
of Friends::list.