pub struct Profile {Show 13 fields
pub id: String,
pub username: String,
pub password: String,
pub salt: String,
pub tokens: Vec<String>,
pub ips: Vec<String>,
pub token_context: Vec<TokenContext>,
pub metadata: ProfileMetadata,
pub badges: Vec<(String, String, String)>,
pub group: i32,
pub joined: u128,
pub tier: i32,
pub labels: Vec<String>,
}
Expand description
Basic user structure
Fields§
§id: String
User ID
username: String
User name
password: String
Hashed user password
salt: String
User password salt
tokens: Vec<String>
User login tokens
ips: Vec<String>
User IPs (these line up with the tokens in tokens
)
token_context: Vec<TokenContext>
Extra information about tokens (these line up with the tokens in tokens
)
metadata: ProfileMetadata
Extra user information
badges: Vec<(String, String, String)>
User badges
Vec<(Text, Background, Text Color)>
group: i32
User group
joined: u128
User join timestamp
tier: i32
User tier for paid benefits
labels: Vec<String>
The labels applied to the user (comma separated when as string with 1 comma at the end which creates an empty label)
Implementations§
source§impl Profile
impl Profile
sourcepub fn token_context_from_token(&self, token: &str) -> TokenContext
pub fn token_context_from_token(&self, token: &str) -> TokenContext
Get context from a token
Trait Implementations§
source§impl<'de> Deserialize<'de> for Profile
impl<'de> Deserialize<'de> for Profile
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>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations§
impl Freeze for Profile
impl RefUnwindSafe for Profile
impl Send for Profile
impl Sync for Profile
impl Unpin for Profile
impl UnwindSafe for Profile
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
source§impl<T> IntoEither for T
impl<T> IntoEither for T
source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moresource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more