Skip to main content

Region

Enum Region 

Source
pub enum Region<'a> {
    Band,
    Sidebar,
    Pane,
    Split,
    TabGroup,
    Modal,
    Bespoke {
        name: &'a str,
    },
}
Expand description

A named part of a screen.

The thing makeover-geometry deliberately does not name: it names the space between things by relationship, and nothing named the things. Six named members, taken from what the two webview apps actually use, plus Region::Bespoke for the parts no description should reach. Both apps’ layout.css currently names exactly two things, .raised and .well, so this layer is absent rather than divergent, which makes it the cheapest of the schemas to add and the easiest to over-build.

Variants§

§

Band

A full-width strip with a title slot and an actions cluster, either of which may be empty. goingson’s .page-header, Balanced Breakfast’s .header and .detail-header are all this, differing only in which slots they fill.

§

Sidebar

A persistent column beside the content, holding navigation.

§

Pane

A region of content with its own scroll.

§

Split

Two panes side by side, where the left chooses what the right shows.

§

TabGroup

A set of panes, one visible at a time, with a Selector::Tabs above.

§

Modal

Content over a scrim, taking input until dismissed.

§

Bespoke

A region this crate names the place of and nothing else. The app owns what goes in it.

The escape hatch, and the thing that keeps the description honest about its own limits. A day-plan timeline, a kanban board, a calendar and the paint interaction over the timeline are not describable here and are not going to become describable: a description expressive enough to produce a timeline is a widget library wearing a description’s name.

But a screen containing one still has to be a screen. Without this member the description covers only the boring screens, and the four that make goingson worth using would need a second, undescribed path beside the router. Two paths is how the vocabulary starts drifting from the app again, which is the exact failure this crate exists to end.

So the description says “a thing called day-plan goes here” and stops. The name is opaque: this crate never interprets it, and no renderer is expected to know what it means beyond handing the space over.

Fields

§name: &'a str

What the app calls it. Never interpreted here.

Implementations§

Source§

impl Region<'_>

Source

pub const fn depth(self) -> Depth

How the region sits on what is behind it.

Source

pub const fn described(self) -> bool

Whether this crate can say anything about the region’s contents.

A renderer walks the description and hands every region it understands to the right drawing code. This is how it tells the two apart, and the reason it is a method rather than a matches! at each renderer: there is exactly one opaque member and there should stay exactly one.

Trait Implementations§

Source§

impl<'a> Clone for Region<'a>

Source§

fn clone(&self) -> Region<'a>

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<'a> Copy for Region<'a>

Source§

impl<'a> Debug for Region<'a>

Source§

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

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

impl<'a> Eq for Region<'a>

Source§

impl<'a> Hash for Region<'a>

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<'a> PartialEq for Region<'a>

Source§

fn eq(&self, other: &Region<'a>) -> bool

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

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

Inequality operator !=. Read more
Source§

impl<'a> StructuralPartialEq for Region<'a>

Auto Trait Implementations§

§

impl<'a> Freeze for Region<'a>

§

impl<'a> RefUnwindSafe for Region<'a>

§

impl<'a> Send for Region<'a>

§

impl<'a> Sync for Region<'a>

§

impl<'a> Unpin for Region<'a>

§

impl<'a> UnsafeUnpin for Region<'a>

§

impl<'a> UnwindSafe for Region<'a>

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.