ActiveConfiguration

Struct ActiveConfiguration 

Source
pub struct ActiveConfiguration {
    pub chip: Chip,
    pub selected: Vec<String>,
    pub options: Vec<GeneratorOptionItem>,
}

Fields§

§chip: Chip

The chip that is configured for

§selected: Vec<String>

The names of the selected options

§options: Vec<GeneratorOptionItem>

All available options

Implementations§

Source§

impl ActiveConfiguration

Source

pub fn is_group_selected(&self, group: &str) -> bool

Source

pub fn is_selected(&self, option: &str) -> bool

Source

pub fn selected_index(&self, option: &str) -> Option<usize>

Source

pub fn select(&mut self, option: String)

Source

pub fn is_active(&self, item: &GeneratorOptionItem) -> bool

Returns whether an item is active (can be selected).

This function is different from is_option_active in that it handles categories as well.

Source

pub fn is_option_active(&self, option: &GeneratorOption) -> bool

Returns whether an option is active (can be selected).

This involves checking if the option is available for the current chip, if it’s not disabled by any other selected option, and if all its requirements are met.

Source

pub fn can_be_disabled(&self, option: &str) -> bool

Source

pub fn collect_relationships<'a>( &'a self, option: &'a GeneratorOptionItem, ) -> Relationships<'a>

Trait Implementations§

Source§

impl Debug for ActiveConfiguration

Source§

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

Formats the value using the given formatter. 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> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self>

Converts self into a Left variant of Either<Self, Self> if into_left is true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

Converts self into a Left variant of Either<Self, Self> if into_left(&self) returns true. Converts self into a Right variant of Either<Self, Self> otherwise. 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.