Skip to main content

UserSettings

Struct UserSettings 

Source
pub struct UserSettings {
Show 49 fields pub display_name: String, pub biography: String, pub warning: String, pub private_profile: bool, pub theme_preference: ThemePreference, pub profile_theme: ThemePreference, pub private_last_seen: bool, pub theme_color_surface: String, pub theme_color_text: String, pub theme_color_text_link: String, pub theme_color_shadow: String, pub theme_color_lowered: String, pub theme_color_text_lowered: String, pub theme_color_super_lowered: String, pub theme_color_raised: String, pub theme_color_text_raised: String, pub theme_color_super_raised: String, pub theme_color_primary: String, pub theme_color_text_primary: String, pub theme_color_primary_lowered: String, pub theme_color_secondary: String, pub theme_color_text_secondary: String, pub theme_color_secondary_lowered: String, pub theme_custom_css: String, pub theme_color_online: String, pub theme_color_idle: String, pub theme_color_offline: String, pub disable_other_themes: bool, pub enable_questions: bool, pub motivational_header: String, pub allow_anonymous_questions: bool, pub anonymous_username: String, pub anonymous_avatar_url: String, pub hide_dislikes: bool, pub require_account: bool, pub show_nsfw: bool, pub inbox_homepage: bool, pub muted: Vec<String>, pub enable_drawings: bool, pub all_timeline_hide_answers: bool, pub large_text: bool, pub disable_achievements: bool, pub hide_from_social_lists: bool, pub private_biography: String, pub hide_social_follows: bool, pub location: String, pub links: Vec<(String, String)>, pub auto_nsfw: bool, pub auto_limit_posts: bool,
}

Fields§

§display_name: String§biography: String§warning: String§private_profile: bool§theme_preference: ThemePreference

The theme shown to the user.

§profile_theme: ThemePreference

The theme used on the user’s profile. Setting this to Auto will use the viewing user’s theme_preference setting.

§private_last_seen: bool§theme_color_surface: String

Page background.

§theme_color_text: String

Text on elements with the surface backgrounds.

§theme_color_text_link: String

Links on all elements.

§theme_color_shadow: String

Box shadow color.

§theme_color_lowered: String

Some cards, buttons, or anything else with a darker background color than the surface.

§theme_color_text_lowered: String

Text on elements with the lowered backgrounds.

§theme_color_super_lowered: String

Borders.

§theme_color_raised: String

Some cards, buttons, or anything else with a lighter background color than the surface.

§theme_color_text_raised: String

Text on elements with the raised backgrounds.

§theme_color_super_raised: String

Some borders.

§theme_color_primary: String

Primary color; navigation bar, some buttons, etc.

§theme_color_text_primary: String

Text on elements with the primary backgrounds.

§theme_color_primary_lowered: String

Hover state for primary buttons.

§theme_color_secondary: String

Secondary color.

§theme_color_text_secondary: String

Text on elements with the secondary backgrounds.

§theme_color_secondary_lowered: String

Hover state for secondary buttons.

§theme_custom_css: String

Custom CSS input.

§theme_color_online: String

The color of an online online indicator.

§theme_color_idle: String

The color of an idle online indicator.

§theme_color_offline: String

The color of an offline online indicator.

§disable_other_themes: bool§enable_questions: bool§motivational_header: String

A header shown in the place of “Ask question” if enable_questions is true.

§allow_anonymous_questions: bool

If questions from anonymous users are allowed. Requires enable_questions.

§anonymous_username: String

The username used for anonymous users.

§anonymous_avatar_url: String

The URL of the avatar used for anonymous users.

§hide_dislikes: bool

If dislikes are hidden for the user.

§require_account: bool

Require an account to view the user’s profile.

§show_nsfw: bool

If NSFW content should be shown.

§inbox_homepage: bool

Make your inbox your homepage.

§muted: Vec<String>

A list of strings the user has muted.

§enable_drawings: bool

If drawings are enabled for questions sent to the user.

§all_timeline_hide_answers: bool

Hide posts that are answering a question on the “All” timeline.

§large_text: bool

Increase the text size of buttons and paragraphs.

§disable_achievements: bool

Disable achievements.

§hide_from_social_lists: bool

If the user is hidden from followers/following tabs.

The user will still impact the followers/following numbers, but will not be shown in the UI (or API).

§private_biography: String

Biography shown on profile/private.lisp page.

§hide_social_follows: bool

If the followers/following links are hidden from the user’s profile. Will also revoke access to their respective pages.

§location: String

The user’s location. This isn’t actually verified or anything, so it can really be whatever the user wants.

§links: Vec<(String, String)>

External links for the user’s other profiles on other websites.

§auto_nsfw: bool

Automatically mark new posts as NSFW.

§auto_limit_posts: bool

Automatically limit the reach of new posts (don’t show them on public timelines).

Implementations§

Trait Implementations§

Source§

impl Clone for UserSettings

Source§

fn clone(&self) -> UserSettings

Returns a duplicate 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 UserSettings

Source§

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

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

impl Default for UserSettings

Source§

fn default() -> UserSettings

Returns the “default value” for a type. Read more
Source§

impl<'de> Deserialize<'de> for UserSettings

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 UserSettings

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

impl Validate for UserSettings

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, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> FromJsonReader for T

Source§

fn from_json_reader<R>(reader: R) -> Result<T, Error<Error>>
where R: Read,

Convert from json reader. Read more
Source§

impl<'de, T> FromJsonSlice<'de> for T
where T: Deserialize<'de> + Validate,

Source§

fn from_json_slice(slice: &'de [u8]) -> Result<T, Error<Error>>

Convert from json slice. Read more
Source§

impl<'de, T> FromJsonStr<'de> for T
where T: Deserialize<'de> + Validate,

Source§

fn from_json_str(str: &'de str) -> Result<T, Error<Error>>

Convert from json str. Read more
Source§

impl<T> FromJsonValue for T

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
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> IntoEither for T

Source§

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

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

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

impl<T> PolicyExt for T
where T: ?Sized,

Source§

fn and<P, B, E>(self, other: P) -> And<T, P>
where T: Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow only if self and other return Action::Follow. Read more
Source§

fn or<P, B, E>(self, other: P) -> Or<T, P>
where T: Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow if either self or other returns Action::Follow. Read more
Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> ToJsonString for T
where T: Serialize + Validate,

Source§

fn to_json_string(&self) -> Result<String, Error>

Convert to json string. Read more
Source§

fn to_json_string_pretty(&self) -> Result<String, Error>

Convert to json pretty string. Read more
Source§

impl<T> ToJsonValue for T
where T: Serialize + Validate,

Source§

fn to_json_value(&self) -> Result<Value, Error>

Convert to json string. Read more
Source§

impl<T> ToJsonWriter for T
where T: Serialize + Validate,

Source§

fn to_json_writer<W>(&self, writer: W) -> Result<(), Error>
where W: Write,

Convert to json writer. Read more
Source§

fn to_json_writer_pretty<W>(&self, writer: W) -> Result<(), Error>
where W: Write,

Convert to pretty json writer. Read more
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<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V

Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

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