shared::domain::user

Struct UserProfile

Source
pub struct UserProfile {
Show 36 fields pub id: UserId, pub username: String, pub email: String, pub is_oauth: bool, pub given_name: String, pub family_name: String, pub profile_image: Option<ImageId>, pub language_app: String, pub language_emails: String, pub languages_spoken: Vec<String>, pub opt_into_edu_resources: bool, pub over_18: bool, pub timezone: Tz, pub bio: String, pub badge: Option<UserBadge>, pub location_public: bool, pub organization_public: bool, pub persona_public: bool, pub languages_spoken_public: bool, pub bio_public: bool, pub circles: Vec<CircleId>, pub scopes: Vec<UserScope>, pub created_at: DateTime<Utc>, pub updated_at: Option<DateTime<Utc>>, pub organization: Option<String>, pub persona: Vec<String>, pub subjects: Vec<SubjectId>, pub age_ranges: Vec<AgeRangeId>, pub affiliations: Vec<AffiliationId>, pub location: Option<Value>, pub jig_count: u64, pub resource_count: u64, pub course_count: u64, pub playlist_count: u64, pub total_asset_count: u64, pub account_summary: Option<UserAccountSummary>,
}
Expand description

A user’s profile.

Fields§

§id: UserId

The user’s id.

§username: String

The user’s username.

§email: String

The user’s email address.

§is_oauth: bool

Indicator for Oauth email

§given_name: String

The user’s given name (first name)

§family_name: String

The user’s family name (last name)

§profile_image: Option<ImageId>

ID to the user’s profile image in the user image library.

§language_app: String

The user’s preferred application language.

§language_emails: String

The user’s preferred email language.

§languages_spoken: Vec<String>

The user’s preferred language.

§opt_into_edu_resources: bool

Does the user want educational resources sent to them?

§over_18: bool

Is the user over 18 years old?

§timezone: Tz

The user’s timezone.

§bio: String

Bio for User

§badge: Option<UserBadge>

Badge of User

§location_public: bool

Allow location to be public

§organization_public: bool

Allow organization to be public

§persona_public: bool

Allow persona to be public

§languages_spoken_public: bool

Allow languages_spoken to be public

§bio_public: bool

Allow bio to be public

§circles: Vec<CircleId>

User associated Circles

§scopes: Vec<UserScope>

The scopes associated with the user.

§created_at: DateTime<Utc>

When the user was created.

§updated_at: Option<DateTime<Utc>>

When the user was last updated.

§organization: Option<String>

The organization that the user belongs to.

§persona: Vec<String>

The persona of the user

§subjects: Vec<SubjectId>

The user’s taught subjects.

§age_ranges: Vec<AgeRangeId>

The user’s age-ranges.

§affiliations: Vec<AffiliationId>

The user’s affiliations.

§location: Option<Value>

The user’s location

§jig_count: u64

Number of Jigs

§resource_count: u64

Number of Resources

§course_count: u64

Number of Courses

§playlist_count: u64

Number of playlists

§total_asset_count: u64

Total number of assets

§account_summary: Option<UserAccountSummary>

The user’s account summary, if available.

Note: This is not set when fetching a user profile. It must be explicitly set using a function such as [db::account::get_user_account_summary()]

Implementations§

Source§

impl UserProfile

Source

pub fn school_or_organization(&self) -> Option<&str>

Returns the school or organization associated with this user if any.

Source§

impl UserProfile

Source

pub fn display_name(&self) -> String

Returns the display name for UI purposes

Trait Implementations§

Source§

impl Clone for UserProfile

Source§

fn clone(&self) -> UserProfile

Returns a copy of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for UserProfile

Source§

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

Formats the value using the given formatter. Read more
Source§

impl<'de> Deserialize<'de> for UserProfile

Source§

fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>
where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
Source§

impl Serialize for UserProfile

Source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more

Auto Trait Implementations§

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> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dst: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dst. 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> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

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

Source§

type Error = Infallible

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

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

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

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,

Source§

impl<T> ErasedDestructor for T
where T: 'static,

Source§

impl<T> MaybeSendSync for T