NcSelectorBuilder

Struct NcSelectorBuilder 

Source
pub struct NcSelectorBuilder { /* private fields */ }
Expand description

A handy builder for NcSelector.

Implementations§

Source§

impl NcSelectorBuilder

Source

pub fn new() -> Self

New NcSelectorBuilder.

Source

pub fn item(self, o: &str, d: &str) -> Self

Adds an item.

Source

pub fn default_item(self, item: u32) -> Self

Selects the default item

It is selected at the start and must be between 0 and itemcount-1.

Source

pub fn max_display(self, max: u32) -> Self

Selects the maximum number of items to display at once.

0 uses all available space.

Source

pub fn title(self, title: &str) -> Self

Sets the title string.

Source

pub fn secondary(self, secondary: &str) -> Self

Sets the secondary title string.

Source

pub fn footer(self, footer: &str) -> Self

Sets the footer string.

Source

pub fn flags(self, flags: u64) -> Self

Sets the flags.

Source

pub fn all_channels( self, item_opt: impl Into<NcChannels>, item_desc: impl Into<NcChannels>, seltitle: impl Into<NcChannels>, selfooter: impl Into<NcChannels>, selbox: impl Into<NcChannels>, ) -> Self

Sets all the NcChannels.

Source

pub fn item_channels( self, opt: impl Into<NcChannels>, desc: impl Into<NcChannels>, ) -> Self

Sets the NcChannels for the item.

Source

pub fn title_channels(self, title: impl Into<NcChannels>) -> Self

Sets the NcChannels for the title.

Source

pub fn secondary_channels(self, secondary: impl Into<NcChannels>) -> Self

Sets the NcChannels for the secondary title and the footer.

Source

pub fn box_channels(self, box: impl Into<NcChannels>) -> Self

Sets the NcChannels for the box title.

Source

pub fn finish(self, plane: &mut NcPlane) -> NcResult<&mut NcSelector>

Finishes the builder and returns the NcSelector.

Trait Implementations§

Source§

impl Debug for NcSelectorBuilder

Source§

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

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

impl Default for NcSelectorBuilder

Source§

fn default() -> NcSelectorBuilder

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

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