Skip to main content

Arrangement

Enum Arrangement 

Source
pub enum Arrangement {
    ListDetail {
        tabbed: bool,
        share: Share,
    },
    SidebarContent {
        share: Share,
    },
    Single,
}
Expand description

How a screen is laid out.

Three, and no one of them is a variant of another. goingson is list-detail, Balanced Breakfast is sidebar plus content, and MNW’s embeds are one region filling the document. The tab group is a modifier rather than a member, because goingson uses it inside the same content region rather than instead of one.

This exists at all because the router has to be able to express a screen rather than only a control. Discovering the arrangement layer missing after the renderers exist is a redesign; naming two now is a morning.

§Why the share rides here

A share is per-arrangement: how much a sidebar takes and how much a list side takes are different questions, and this enum is the only thing that knows which one is being asked. Geometry would have had to invent a channel to be told.

list_detail and sidebar_content build these with the default shares, so a screen that has no opinion does not have to have one.

Variants§

§

ListDetail

A list that chooses what the detail beside it shows.

Fields

§tabbed: bool

Whether the detail side is a Region::TabGroup.

§share: Share

How much of the width the list side takes.

§

SidebarContent

Navigation down the side, content filling the rest.

Fields

§share: Share

How much of the width the sidebar takes.

§

Single

One region, filling the document.

The other two are both about dividing a width between two regions, so a screen that is one region had to borrow one of them and then undo it: MNW’s five embeds said list_detail(title, false) and the host spent a display: block cancelling the grid that produced. A host writing CSS to contradict the description rather than to add to it is the thing this member ends.

Carries no Share, because there is no division to describe. That is why share answers None here.

Implementations§

Source§

impl Arrangement

Source

pub const fn list_detail(tabbed: bool) -> Self

A list and a detail beside it, at the default share.

Source

pub const fn sidebar_content() -> Self

A sidebar and content beside it, at the default share.

Source

pub const fn share(self) -> Option<Share>

How much of the width the first region takes, when two regions divide it.

None for Single: one region takes the width, and a renderer that asked how to divide it was asking the wrong question. It answers Option rather than a full-width Share so that a host cannot quietly draw a one-region screen as a grid with an empty second column.

Source

pub const fn with_share(self, share: Share) -> Self

The same arrangement, at this share.

Single is returned unchanged: it has no division to set, so a share named for it is a statement about nothing rather than an error worth refusing a screen over.

Trait Implementations§

Source§

impl Clone for Arrangement

Source§

fn clone(&self) -> Arrangement

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 Arrangement

Source§

impl Debug for Arrangement

Source§

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

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

impl Eq for Arrangement

Source§

impl Hash for Arrangement

Source§

fn hash<__H: Hasher>(&self, state: &mut __H)

Feeds this value into the given Hasher. Read more
1.3.0 · Source§

fn hash_slice<H>(data: &[Self], state: &mut H)
where H: Hasher, Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
Source§

impl PartialEq for Arrangement

Source§

fn eq(&self, other: &Arrangement) -> 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 Arrangement

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 = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

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.