SettingValue

Enum SettingValue 

Source
pub enum SettingValue {
    Group {
        footer: Option<Cow<'static, str>>,
        items: Vec<Setting>,
    },
    Select {
        values: Vec<Cow<'static, str>>,
        titles: Option<Vec<Cow<'static, str>>>,
        auth_to_open: Option<bool>,
        default: Option<String>,
    },
    MultiSelect {
        values: Vec<Cow<'static, str>>,
        titles: Option<Vec<Cow<'static, str>>>,
        auth_to_open: Option<bool>,
        default: Option<Vec<String>>,
    },
    Toggle {
        subtitle: Option<Cow<'static, str>>,
        auth_to_disable: Option<bool>,
        default: bool,
    },
    Stepper {
        minimum_value: f64,
        maximum_value: f64,
        step_value: Option<f64>,
        default: Option<f64>,
    },
    Segment {
        options: Vec<Cow<'static, str>>,
        default: Option<i32>,
    },
    Text {
        placeholder: Option<Cow<'static, str>>,
        autocapitalization_type: Option<i32>,
        autocorrection_disabled: Option<bool>,
        keyboard_type: Option<i32>,
        return_key_type: Option<i32>,
        secure: Option<bool>,
        default: Option<Cow<'static, str>>,
    },
    Button,
    Link {
        url: Cow<'static, str>,
        external: Option<bool>,
    },
    Login {
        method: LoginMethod,
        url: Option<Cow<'static, str>>,
        url_key: Option<Cow<'static, str>>,
        logout_title: Option<Cow<'static, str>>,
        pkce: bool,
        token_url: Option<Cow<'static, str>>,
        callback_scheme: Option<Cow<'static, str>>,
        use_email: bool,
        local_storage_keys: Option<Vec<String>>,
    },
    Page {
        items: Vec<Setting>,
        inline_title: Option<bool>,
        auth_to_open: Option<bool>,
        icon: Option<PageIcon>,
        info: Option<String>,
    },
    EditableList {
        line_limit: Option<i32>,
        inline: bool,
        placeholder: Option<Cow<'static, str>>,
        default: Option<Vec<Cow<'static, str>>>,
    },
}
Expand description

The kind of setting.

Variants§

§

Group

A group of settings.

Fields

§footer: Option<Cow<'static, str>>

Optional footer text for the group.

§items: Vec<Setting>

The settings contained in this group.

§

Select

A page that allows selection of a single value.

Fields

§values: Vec<Cow<'static, str>>

The values of the options.

§titles: Option<Vec<Cow<'static, str>>>

Optional display titles for the options. If not provided, the values will be used as titles.

§auth_to_open: Option<bool>

Whether to require authentication to open the page for this setting.

§default: Option<String>

The default selected value.

§

MultiSelect

A page that allows selection of multiple values.

Fields

§values: Vec<Cow<'static, str>>

The values of the options.

§titles: Option<Vec<Cow<'static, str>>>

Optional display titles for the options. If not provided, the values will be used as titles.

§auth_to_open: Option<bool>

Whether to require authentication to open the page for this setting.

§default: Option<Vec<String>>

The default selected value(s).

§

Toggle

A toggle switch.

Fields

§subtitle: Option<Cow<'static, str>>

Optional subtitle text.

§auth_to_disable: Option<bool>

Whether to require authentication to turn the toggle off.

§default: bool

The default state of the toggle.

§

Stepper

A numeric stepper control.

Fields

§minimum_value: f64

The minimum allowed value.

§maximum_value: f64

The maximum allowed value.

§step_value: Option<f64>

Optional step increment value.

§default: Option<f64>

The default value.

§

Segment

A segmented control.

Fields

§options: Vec<Cow<'static, str>>

The options shown on the segments.

§default: Option<i32>

The default selected segment index.

§

Text

A text input field.

Fields

§placeholder: Option<Cow<'static, str>>

Optional placeholder text when the field is empty.

§autocapitalization_type: Option<i32>

The autocapitalization type.

§autocorrection_disabled: Option<bool>

Whether autocorrection should be disabled.

§keyboard_type: Option<i32>

The keyboard type.

§return_key_type: Option<i32>

The return key type.

§secure: Option<bool>

Whether the text field is for secure entry (password).

§default: Option<Cow<'static, str>>

The default text value.

§

Button

A clickable button.

A link to a URL.

Fields

§url: Cow<'static, str>

The URL to open on press.

§external: Option<bool>

Whether the link should open in an external browser.

§

Login

A login control.

Fields

§method: LoginMethod

The authentication method to use.

§url: Option<Cow<'static, str>>

The authentication URL.

§url_key: Option<Cow<'static, str>>

An optional defaults key to fetch the URL from.

§logout_title: Option<Cow<'static, str>>

The title for the logout button. If not provided, the title will be “Log Out”.

§pkce: bool

Whether to use PKCE for the OAuth flow.

§token_url: Option<Cow<'static, str>>

The token URL for OAuth.

§callback_scheme: Option<Cow<'static, str>>

The callback scheme for OAuth.

§use_email: bool

Whether to prompt for an email instead of username for basic authentication.

§local_storage_keys: Option<Vec<String>>

An array of localStorage keys to extract after login.

§

Page

A page of settings.

Fields

§items: Vec<Setting>

The settings contained in this page.

§inline_title: Option<bool>

Whether to display the title inline.

§auth_to_open: Option<bool>

Whether to require authentication to open the page.

§icon: Option<PageIcon>

An icon to be displayed along with the page title.

§info: Option<String>

An optional string to display under the title in a header view (an icon must also be provided).

§

EditableList

A list that can be edited by the user.

Fields

§line_limit: Option<i32>

Optional maximum number of lines.

§inline: bool

Whether to display the list inline.

§placeholder: Option<Cow<'static, str>>

Optional placeholder text for new items.

§default: Option<Vec<Cow<'static, str>>>

The default list items.

Trait Implementations§

Source§

impl Clone for SettingValue

Source§

fn clone(&self) -> SettingValue

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 SettingValue

Source§

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

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

impl PartialEq for SettingValue

Source§

fn eq(&self, other: &SettingValue) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl Serialize for SettingValue

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 StructuralPartialEq for SettingValue

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, 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.