Skip to main content

Layout

Struct Layout 

Source
pub struct Layout {
    pub show: BTreeMap<String, Show>,
    pub order: BTreeMap<String, Vec<String>>,
}
Expand description

What the interface shows: the modes and orders that differ from the defaults.

Fields§

§show: BTreeMap<String, Show>

Element id → how it is shown.

§order: BTreeMap<String, Vec<String>>

Region id → element ids in the order wanted. Ids a region doesn’t have are skipped; those it has but the list doesn’t name follow, in their default order.

Implementations§

Source§

impl Layout

Source

pub fn is_default(&self) -> bool

Source

pub fn show(&self, id: &str) -> Show

How element (or plugin view) id is shown. Unknown ids are shown.

Source

pub fn visible(&self, id: &str, hovered: bool) -> bool

Whether id is drawn now (hovered: the pointer is on what it belongs to).

Source

pub fn set_show(&mut self, id: &str, mode: Show)

Set how id is shown; back to the default stores nothing.

Source

pub fn arrange(&self, region: &str, extra: &[String]) -> Vec<String>

Region region’s elements in order: byob’s own (in ELEMENTS order) and then extra (plugin views drawn there, as found), arranged by the stored order. Hidden ones are included; ask Self::show.

Source

pub fn set_order(&mut self, region: &str, ids: Vec<String>)

Put region region in this order (see Self::order); the default order stores nothing.

Source

pub fn nudge(&mut self, region: &str, extra: &[String], id: &str, dir: i32)

Move id one place earlier (dir < 0) or later within region region, among extra.

Source

pub fn preset(name: &str) -> Option<Layout>

A ready-made layout by name (PRESETS).

Source

pub fn sanitized(self) -> Layout

Drop what a broken or hostile file could hold: too many entries, absurd ids, empty orders.

Trait Implementations§

Source§

impl Clone for Layout

Source§

fn clone(&self) -> Layout

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 Debug for Layout

Source§

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

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

impl Default for Layout

Source§

fn default() -> Layout

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

impl<'de> Deserialize<'de> for Layout
where Layout: Default,

Source§

fn deserialize<__D>( __deserializer: __D, ) -> Result<Layout, <__D as Deserializer<'de>>::Error>
where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
Source§

impl Eq for Layout

Source§

impl PartialEq for Layout

Source§

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

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

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

Inequality operator !=. Read more
Source§

impl Serialize for Layout

Source§

fn serialize<__S>( &self, __serializer: __S, ) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more
Source§

impl StructuralPartialEq for Layout

Auto Trait Implementations§

§

impl Forget for Layout

§

impl Freeze for Layout

§

impl Move for Layout

§

impl RefUnwindSafe for Layout

§

impl Send for Layout

§

impl Sync for Layout

§

impl Unpin for Layout

§

impl UnsafeUnpin for Layout

§

impl UnwindSafe for Layout

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> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,

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.