Skip to main content

Group

Struct Group 

Source
pub struct Group { /* private fields */ }
Expand description

One group of settings (docs/settings.md): a page on desktop (a toolbar tab, a dialog page, a sidebar entry) and a row of the mobile root list that pushes the page.

Implementations§

Source§

impl Group

Source

pub fn new<M>(id: &'static str, title: impl IntoText<M>) -> Self

A group with a route id (also its element id, prefs-group-<id>) and a localized title.

Source

pub fn icon(self, icon: impl Into<GroupIcon>) -> Self

The glyph beside the title: a bundled vector (the same name a nav item takes) or a standard day_spec::Symbol.

Source

pub fn subtitle<M>(self, t: impl IntoText<M>) -> Self

One line under the title in the mobile root list (“Units, data source”).

Source

pub fn section(self, section: Section) -> Self

Append a section.

Source

pub fn row(self, row: Row) -> Self

Append a row to the group’s trailing untitled section (created as needed).

Source

pub fn custom<P: Piece>(self, build: impl Fn() -> P + 'static) -> Self

A bespoke piece that is the whole group page (Skies’ city editor). Sections, if any, render above it.

Source

pub fn order(self, order: i32) -> Self

Sort key: app groups keep declaration order at 0, providers default to 500, About is always last.

Source

pub fn available(self, f: impl Fn() -> bool + 'static) -> Self

Hide the whole group when false (evaluated at install and at each build).

Source

pub fn requires(self, cap: Cap) -> Self

Hide the group unless the toolkit supports cap.

Source

pub fn id(&self) -> &'static str

The route id.

Trait Implementations§

Source§

impl Clone for Group

Source§

fn clone(&self) -> Group

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

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

Performs copy-assignment from source. Read more

Auto Trait Implementations§

§

impl !RefUnwindSafe for Group

§

impl !Send for Group

§

impl !Sync for Group

§

impl !UnwindSafe for Group

§

impl Freeze for Group

§

impl Unpin for Group

§

impl UnsafeUnpin for Group

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
§

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

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> 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> IntoReactive<T, StaticMark> for T
where T: Clone + 'static,

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.