pub struct ActiveConfiguration {
pub chip: Chip,
pub selected: Vec<String>,
pub options: Vec<GeneratorOptionItem>,
}Fields§
§chip: ChipThe chip that is configured for
selected: Vec<String>The names of the selected options
options: Vec<GeneratorOptionItem>All available options
Implementations§
Source§impl ActiveConfiguration
impl ActiveConfiguration
pub fn is_group_selected(&self, group: &str) -> bool
pub fn is_selected(&self, option: &str) -> bool
pub fn selected_index(&self, option: &str) -> Option<usize>
pub fn select(&mut self, option: String)
Sourcepub fn is_active(&self, item: &GeneratorOptionItem) -> bool
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.
Sourcepub fn is_option_active(&self, option: &GeneratorOption) -> bool
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.
pub fn can_be_disabled(&self, option: &str) -> bool
pub fn collect_relationships<'a>( &'a self, option: &'a GeneratorOptionItem, ) -> Relationships<'a>
Trait Implementations§
Auto Trait Implementations§
impl Freeze for ActiveConfiguration
impl RefUnwindSafe for ActiveConfiguration
impl Send for ActiveConfiguration
impl Sync for ActiveConfiguration
impl Unpin for ActiveConfiguration
impl UnwindSafe for ActiveConfiguration
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
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 moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
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