Skip to main content

Panel

Struct Panel 

Source
pub struct Panel {
    pub groups: &'static [Group],
    pub exhaustive: bool,
}
Expand description

One body’s controls, grouped the way its instrument groups them.

⚠️ Not the Electro 5’s CenterPanel and friends, which are bodies — nested #[bitbody]s at a byte range. This is the panel as a reader sees it, and it cuts across those bodies freely.

Fields§

§groups: &'static [Group]

The sections, in the order a reader meets them.

§exhaustive: bool

Whether the groups account for every field the body registers.

True is checked by this module’s tests, so an exhaustive layout stays exhaustive as the body grows: a newly declared field fails the test until it is placed. False means Self::leftovers can be non-empty and a caller needs somewhere to put it.

Implementations§

Source§

impl Panel

Source

pub fn walk(&self) -> Vec<&Group>

Every group in the layout, sections and their nested clusters alike, depth first.

⚠️ Not groups, which is the top level alone.

Source

pub fn named<'a>(&self, specs: &'a [FieldSpec]) -> Vec<&'a str>

Every path the layout names, in layout order, globs expanded.

Source

pub fn leftovers<'a>(&self, specs: &'a [FieldSpec]) -> Vec<&'a str>

The registered fields no group names, in registry order.

A morph slot whose parameter is named is not among them: it is drawn on that parameter’s control, so a caller that has rendered the parameter has rendered it.

Source§

impl Panel

Source

pub fn resolve<'a>(&'a self, fields: &'a [Field]) -> Resolved<'a>

The layout against one body’s field values: every group with its own fields and its effective relevance, plus whatever no group named.

One pass builds an index of the body’s paths, so drawing a layout costs about one walk of the field list however many members the groups name — which matters at the Stage bodies’ scale.

Trait Implementations§

Source§

impl Debug for Panel

Source§

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

Formats the value using the given formatter. Read more

Auto Trait Implementations§

§

impl Freeze for Panel

§

impl RefUnwindSafe for Panel

§

impl Send for Panel

§

impl Sync for Panel

§

impl Unpin for Panel

§

impl UnsafeUnpin for Panel

§

impl UnwindSafe for Panel

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> 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, 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.