Skip to main content

Friends

Struct Friends 

Source
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>

Source

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.

Source

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.

Trait Implementations§

Source§

impl<'a> Debug for Friends<'a>

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

§

impl<'a> Freeze for Friends<'a>

§

impl<'a> RefUnwindSafe for Friends<'a>

§

impl<'a> Send for Friends<'a>

§

impl<'a> Sync for Friends<'a>

§

impl<'a> Unpin for Friends<'a>

§

impl<'a> UnsafeUnpin for Friends<'a>

§

impl<'a> UnwindSafe for Friends<'a>

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.