Skip to main content

KeyBindingsView

Struct KeyBindingsView 

Source
pub struct KeyBindingsView<A> {
    pub title: String,
    pub switch: Option<SwitchView>,
    pub columns: Vec<String>,
    pub groups: Vec<GroupView<A>>,
    pub restore: RestoreView,
    pub not_mapped: String,
    pub message: Option<String>,
    pub question: Option<AskView<bool>>,
    pub choices: Option<ChoicesView>,
    pub help: String,
}
Expand description

The whole screen, as it is this frame.

Fields§

§title: String

The screen’s title.

§switch: Option<SwitchView>

The keyboard / controller switch; None with no keyboard, when the controller side is the only one.

§columns: Vec<String>

The headings over the slot columns, left to right.

§groups: Vec<GroupView<A>>

The actions, grouped: the required ones, then the optional ones.

§restore: RestoreView

The row under the actions that puts the shown side’s defaults back.

§not_mapped: String

The note on a row with nothing in any slot (! not mapped).

§message: Option<String>

A message for the player (a key can’t be used, leaving is blocked).

§question: Option<AskView<bool>>

The yes/no question open over the rows, if any (no answers, but the line naming its keys).

§choices: Option<ChoicesView>

The choices open under the focused slot, if any (the controller side’s change / clear).

§help: String

The help line: what the keys do here.

Implementations§

Source§

impl<A: Copy + PartialEq> KeyBindingsView<A>

Source

pub fn rows(&self) -> impl Iterator<Item = &RowView<A>>

Every action’s row, top to bottom.

Source

pub fn row(&self, action: A) -> Option<&RowView<A>>

The row of action, if it is shown.

Source

pub fn focused(&self) -> Option<&RowView<A>>

The focused row, if the focus is on an action.

Trait Implementations§

Source§

impl<A: Clone> Clone for KeyBindingsView<A>

Source§

fn clone(&self) -> KeyBindingsView<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: Debug> Debug for KeyBindingsView<A>

Source§

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

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

impl<A: Eq> Eq for KeyBindingsView<A>

Source§

impl<A: PartialEq> PartialEq for KeyBindingsView<A>

Source§

fn eq(&self, other: &KeyBindingsView<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: PartialEq> StructuralPartialEq for KeyBindingsView<A>

Auto Trait Implementations§

§

impl<A> Freeze for KeyBindingsView<A>

§

impl<A> RefUnwindSafe for KeyBindingsView<A>
where A: RefUnwindSafe,

§

impl<A> Send for KeyBindingsView<A>
where A: Send,

§

impl<A> Sync for KeyBindingsView<A>
where A: Sync,

§

impl<A> Unpin for KeyBindingsView<A>
where A: Unpin,

§

impl<A> UnsafeUnpin for KeyBindingsView<A>

§

impl<A> UnwindSafe for KeyBindingsView<A>
where A: UnwindSafe,

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> DynClone for T
where T: Clone,

Source§

fn __clone_box(&self, _: Private) -> *mut ()

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.