pub struct Prefs(/* private fields */);Expand description
The handle Preferences::install returns: Copy, so pages and the nav take it by value.
Implementations§
Source§impl Prefs
impl Prefs
Sourcepub fn open(&self) -> bool
pub fn open(&self) -> bool
Open-or-focus the surface: the window on desktop; on mobile, select the nav item when one is mounted, else present the navigation presentation as a cover.
Sourcepub fn open_at(&self, route: &str) -> bool
pub fn open_at(&self, route: &str) -> bool
Open and select a group ("updates"), optionally a row ("updates/check").
Whether the app should place a Settings entry in its own navigation: true where the platform gives no app menu to reach the surface from (the phones); false on the desktops and on the web, whose menu button carries Settings… and About.
The Settings entry for the app’s navigation, titled with the platform’s word and
opening page: Some where Self::in_nav, None where the platform’s
application menu already carries Settings. Goes straight into a nav’s items:
nav(sel).items((…, prefs.nav_item(Section::Settings))).
The Settings entry on every platform, menu or not: for an app that wants Settings in
its sidebar on the desktop too. Most apps want nav_item.
Sourcepub fn page(&self) -> AnyPiece
pub fn page(&self) -> AnyPiece
The navigation presentation as a piece: the destination of the nav item, or any place the app embeds settings.
Sourcepub fn group_page(&self, id: &str) -> AnyPiece
pub fn group_page(&self, id: &str) -> AnyPiece
One group’s page alone (an in-reader sheet, a sidebar pane).
Sourcepub fn group_body(&self, id: &str) -> AnyPiece
pub fn group_body(&self, id: &str) -> AnyPiece
One group’s sections without a scroll, for a sheet that stacks several groups and
owns the scrolling itself: put the bodies in one scroll. The phones keep their native
shape, sized to its rows.
Sourcepub fn about_page(&self) -> AnyPiece
pub fn about_page(&self) -> AnyPiece
The composed About page.
Trait Implementations§
Auto Trait Implementations§
impl !RefUnwindSafe for Prefs
impl !Send for Prefs
impl !Sync for Prefs
impl !UnwindSafe for Prefs
impl Freeze for Prefs
impl Unpin for Prefs
impl UnsafeUnpin for Prefs
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> ErasedDestructor for Twhere
T: 'static,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
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 moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
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