Enum volt::user::UserResult
source · pub enum UserResult {
User(User),
UserFlags(UserFlags),
UserProfile(UserProfile),
String(String),
}Expand description
The enum for data returning
The variations of this enum are the types that are returned after .run() is called
Note!:
If any of the methods that impliment this enum are called the type will change
Variants§
Implementations§
source§impl UserResult
impl UserResult
sourcepub fn badges(&self) -> Vec<&str>
pub fn badges(&self) -> Vec<&str>
Returns the badges a users has
Badges can be earned on Revolt for different things (will explain below)
The API shows badges as the sum of the values of all the badges
Badge Values:
- 1: Developer (Develops Revolt)
- 2: Translator (Translated Revolt into another language)
- 4: Supporter (Supported Revolt with a donation)
- 8: Responsibly Disclosed Bug(s) (Disclosed a bug responibly)
- 16: Founder (Founded Revolt)
- 32: Platform Moderation (Moderates Revolt)
- 64: Active Supporter (Activlty supports Revolt)
- 128: Paw (🦊🦝)
- 256: Early Adopter (One of the first 1000 users)
- 512: ReservedRelevantJokeBadge1 (Amogus)
- 1024 ReservedRelevantJokeBadge2 (Amogus Troll Face)
Returns
A vec<&str> of the badges the user has earned in order from highest value to lowest value
Panics!:
This funtion will panic if the enum variant UserResult::User has not been called
sourcepub fn background(&self) -> Image
pub fn background(&self) -> Image
sourcepub fn status(&self) -> String
pub fn status(&self) -> String
Returns the status text of a user
Returns:
The status text of a user as a string
Note:
This function takes both UserResult::UserProfile and UserResult::User
When UserResult::User is called the value may be “None” if there was no status or there was and error parsing the status
Panics!:
This function will panic if fetch_user_flags was called before
Trait Implementations§
source§impl Clone for UserResult
impl Clone for UserResult
source§fn clone(&self) -> UserResult
fn clone(&self) -> UserResult
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moresource§impl Debug for UserResult
impl Debug for UserResult
source§impl<'de> Deserialize<'de> for UserResult
impl<'de> Deserialize<'de> for UserResult
source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where __D: Deserializer<'de>,
source§impl PartialEq<UserResult> for UserResult
impl PartialEq<UserResult> for UserResult
source§fn eq(&self, other: &UserResult) -> bool
fn eq(&self, other: &UserResult) -> bool
self and other values to be equal, and is used
by ==.