Skip to main content

NavPresentation

Enum NavPresentation 

Source
pub enum NavPresentation {
    Split,
    Stack,
    Tabs,
    Rail,
}
Expand description

How a navigation host lays its panes out (docs/navigation.md).

This is the resolved presentation, what the toolkit must draw right now. The app asks for one through Nav::presentation, where leaving it unset means “automatic”: the pieces layer resolves it from the window’s SizeClass and the toolkit’s Cap::NavSplit, and re-resolves it whenever the class changes. There is no Auto variant here because a backend can only ever draw a concrete one, so the undecided state stays on the app’s side of the boundary where it can still be decided.

Variants§

§

Split

Sidebar beside detail, both visible (NSSplitViewController, nested GtkPaneds, a NavigationView). The sidebar pane gets its own container.

§

Stack

One page at a time, back-navigable. The sidebar pane becomes the stack’s root.

§

Tabs

The rows drawn as a tab bar, one page’s content beside it, no back stack: what a phone-shaped window wants from a one-of-N surface (UITabBarController, a Material NavigationBarView, NavigationView.PaneDisplayMode = Top). The Pane::Sidebar page is not drawn at all: its rows are the chrome.

§

Rail

The rows drawn as a narrow icon strip beside the content, the Medium-width answer between Self::Tabs and Self::Split (a Material NavigationRailView, PaneDisplayMode = LeftCompact, an ArkUI vertical Tabs).

A backend with no rail rounds it to a neighbor of its own choosing rather than failing: UIKit answers Tabs (which is what iPadOS does at that width), GTK the same. Rounding is expected and correct; this variant is a request, not a contract.

Implementations§

Source§

impl NavPresentation

Source

pub fn is_split(self) -> bool

true for NavPresentation::Split, the shape most backend code wants.

Source

pub fn rows_are_chrome(self) -> bool

true when the rows are the chrome rather than a drawn page: Self::Tabs and Self::Rail. Both hide the Pane::Sidebar page and render its rows themselves, so backend code that only cares about that distinction asks this instead of matching both.

Trait Implementations§

Source§

impl Clone for NavPresentation

Source§

fn clone(&self) -> NavPresentation

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

impl Copy for NavPresentation

Source§

impl Debug for NavPresentation

Source§

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

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

impl Default for NavPresentation

Source§

fn default() -> NavPresentation

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

impl Eq for NavPresentation

Source§

impl PartialEq for NavPresentation

Source§

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

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

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

Inequality operator !=. Read more
Source§

impl StructuralPartialEq for NavPresentation

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.
Day API ↩ Guides· daybrite.dev