pub struct SettingItem {
pub key: String,
pub label: String,
pub value: String,
pub description: Option<String>,
pub setting_type: SettingType,
pub values: Vec<String>,
pub has_submenu: bool,
}Expand description
A setting item.
Fields§
§key: StringSetting key.
label: StringDisplay label.
value: StringSetting value.
description: Option<String>Description.
setting_type: SettingTypeSetting type.
values: Vec<String>Values cycled through by SettingsList::activate. Empty for submenu
triggers and read-only rows.
Whether activating the row should call on_select (open a submenu)
rather than cycle values.
Implementations§
Source§impl SettingItem
impl SettingItem
Sourcepub fn with_description(self, description: &str) -> Self
pub fn with_description(self, description: &str) -> Self
Add description.
Sourcepub fn with_type(self, setting_type: SettingType) -> Self
pub fn with_type(self, setting_type: SettingType) -> Self
Set setting type.
Sourcepub fn with_values(self, values: &[&str]) -> Self
pub fn with_values(self, values: &[&str]) -> Self
The cycle order for this row. Activating the row advances to the next
value and fires on_change. Empty ⇒ the row is a submenu trigger or a
read-only display.
Mark the row as a submenu trigger: activating it calls on_select
instead of cycling values.
Trait Implementations§
Source§impl Clone for SettingItem
impl Clone for SettingItem
Auto Trait Implementations§
impl Freeze for SettingItem
impl RefUnwindSafe for SettingItem
impl Send for SettingItem
impl Sync for SettingItem
impl Unpin for SettingItem
impl UnsafeUnpin for SettingItem
impl UnwindSafe for SettingItem
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