/// Get a user from the cache or API.
Get a user from the cache or API.
Get a user from the cache or API .
pub async fn fetch(cx: &Context, id: &Id) -> Result<Self> {
        #[cfg(feature = "cache")]
        if let Some(user) = cx.cache.user(id).await {
            return Ok(user);
        }
        cx.http_client.get(format!("users/{}", id)).await
    }
pub async fn fetch ( cx : & Context , id : & Id ) -> Result < Self > { # [ cfg ( feature " " ) ] if let Some ( user ) = cx . cache . user ( id ) . await { return Ok ( user ) ; } cx . http_client . get ( format ! ( " " id ) ) . await }
Get a user from the cache or API.
Get a user from the cache or API .
cx
&Context
id
&Id