pub struct Profile {Show 22 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<i64>,
pub coins: i32,
pub links: BTreeMap<String, String>,
pub layout: LayoutComponent,
pub question_count: usize,
pub response_count: usize,
pub totp: String,
pub recovery_codes: Vec<String>,
pub notification_count: usize,
pub inbox_count: usize,
}
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<i64>
The labels applied to the user (comma separated when as string with 1 comma at the end which creates an empty label).
Vec<id>
- ID references a label in the xlabels
table.
coins: i32
User coin balance.
links: BTreeMap<String, String>
User links.
layout: LayoutComponent
User layout.
question_count: usize
The number of questions the profile has asked.
response_count: usize
The number of responses the profile has posted.
totp: String
The TOTP secret for this profile. An empty value means the user has TOTP disabled.
recovery_codes: Vec<String>
The TOTP recovery codes for this profile.
notification_count: usize
The number of unread notifications the profile has.
inbox_count: usize
The number of unread questions the profile has in their inbox.
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>,
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
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>
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>
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§impl<T> Pointable for T
impl<T> Pointable for T
Source§impl<R, P> ReadPrimitive<R> for P
impl<R, P> ReadPrimitive<R> for P
Source§fn read_from_little_endian(read: &mut R) -> Result<Self, Error>
fn read_from_little_endian(read: &mut R) -> Result<Self, Error>
ReadEndian::read_from_little_endian()
.