pub struct ColorOutputListBuilder<'a> {
pub output_list: Vec<ColorOutput<'a>>,
}Expand description
Builder pattern for constructing ColorOutputList configurations.
Fields§
§output_list: Vec<ColorOutput<'a>>Collection of ColorOutput configurations being built.
Implementations§
Source§impl<'a> ColorOutputListBuilder<'a>
impl<'a> ColorOutputListBuilder<'a>
Sourcepub fn new() -> Self
pub fn new() -> Self
Creates a new empty ColorOutputListBuilder.
§Returns
ColorOutputListBuilder- New instance with empty output list
Sourcepub fn new_from(output_list: Vec<ColorOutput<'a>>) -> Self
pub fn new_from(output_list: Vec<ColorOutput<'a>>) -> Self
Sourcepub fn add(&mut self, output: ColorOutput<'a>) -> &mut Self
pub fn add(&mut self, output: ColorOutput<'a>) -> &mut Self
Sourcepub fn remove(&mut self, idx: usize) -> &mut Self
pub fn remove(&mut self, idx: usize) -> &mut Self
Removes an output item from the list at the specified index.
§Parameters
&mut self: A mutable reference to the current instance ofColorOutputListBuilder.idx: The index of the output item to be removed.
§Returns
&mut Self: A mutable reference to the current instance, allowing for method chaining.
If the index is out of bounds, the list remains unchanged.
Sourcepub fn clear(&mut self)
pub fn clear(&mut self)
Clears all output items from the output list.
§Parameters
&mut self: A mutable reference to the current instance ofColorOutputListBuilder.
Sourcepub fn run(&mut self) -> &mut Self
pub fn run(&mut self) -> &mut Self
Runs all output items in the list, executing their output logic.
§Parameters
&mut self: A mutable reference to the current instance ofColorOutputListBuilder.
§Returns
&mut Self: A mutable reference to the current instance, allowing for method chaining.
The method clones the current output list, clears the original list, and executes the output for each cloned item.
Sourcepub fn query_idx(&self, idx: usize) -> ColorOutput<'_>
pub fn query_idx(&self, idx: usize) -> ColorOutput<'_>
Sourcepub fn run_idx(&mut self, idx: usize) -> &mut Self
pub fn run_idx(&mut self, idx: usize) -> &mut Self
Runs the output item at the specified index.
§Parameters
&mut self: A mutable reference to the current instance ofColorOutputListBuilder.idx: The index of the output item to run.
§Returns
&mut Self: A mutable reference to the current instance, allowing for method chaining.
If the index is out of bounds, the list remains unchanged.
Trait Implementations§
Source§impl<'a> Clone for ColorOutputListBuilder<'a>
impl<'a> Clone for ColorOutputListBuilder<'a>
Source§fn clone(&self) -> ColorOutputListBuilder<'a>
fn clone(&self) -> ColorOutputListBuilder<'a>
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl<'a> Debug for ColorOutputListBuilder<'a>
impl<'a> Debug for ColorOutputListBuilder<'a>
Source§impl<'a> Default for ColorOutputListBuilder<'a>
impl<'a> Default for ColorOutputListBuilder<'a>
Source§impl<'a> Hash for ColorOutputListBuilder<'a>
impl<'a> Hash for ColorOutputListBuilder<'a>
Source§impl<'a> Ord for ColorOutputListBuilder<'a>
impl<'a> Ord for ColorOutputListBuilder<'a>
Source§fn cmp(&self, other: &ColorOutputListBuilder<'a>) -> Ordering
fn cmp(&self, other: &ColorOutputListBuilder<'a>) -> Ordering
1.21.0 · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the maximum of two values. Read more
Source§impl<'a> PartialEq for ColorOutputListBuilder<'a>
impl<'a> PartialEq for ColorOutputListBuilder<'a>
Source§impl<'a> PartialOrd for ColorOutputListBuilder<'a>
impl<'a> PartialOrd for ColorOutputListBuilder<'a>
impl<'a> Eq for ColorOutputListBuilder<'a>
impl<'a> StructuralPartialEq for ColorOutputListBuilder<'a>
Auto Trait Implementations§
impl<'a> Freeze for ColorOutputListBuilder<'a>
impl<'a> RefUnwindSafe for ColorOutputListBuilder<'a>
impl<'a> Send for ColorOutputListBuilder<'a>
impl<'a> Sync for ColorOutputListBuilder<'a>
impl<'a> Unpin for ColorOutputListBuilder<'a>
impl<'a> UnwindSafe for ColorOutputListBuilder<'a>
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