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() -> ColorOutputListBuilder<'a>
pub fn new() -> ColorOutputListBuilder<'a>
Creates a new empty ColorOutputListBuilder.
§Returns
ColorOutputListBuilder- New instance with empty output list
Sourcepub fn new_from(output_list: Vec<ColorOutput<'a>>) -> ColorOutputListBuilder<'a>
pub fn new_from(output_list: Vec<ColorOutput<'a>>) -> ColorOutputListBuilder<'a>
Sourcepub fn add(
&mut self,
output: ColorOutput<'a>,
) -> &mut ColorOutputListBuilder<'a>
pub fn add( &mut self, output: ColorOutput<'a>, ) -> &mut ColorOutputListBuilder<'a>
Sourcepub fn remove(&mut self, idx: usize) -> &mut ColorOutputListBuilder<'a>
pub fn remove(&mut self, idx: usize) -> &mut ColorOutputListBuilder<'a>
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 ColorOutputListBuilder<'a>
pub fn run(&mut self) -> &mut ColorOutputListBuilder<'a>
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 ColorOutputListBuilder<'a>
pub fn run_idx(&mut self, idx: usize) -> &mut ColorOutputListBuilder<'a>
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§fn default() -> ColorOutputListBuilder<'a>
fn default() -> ColorOutputListBuilder<'a>
Returns the “default value” for a type. Read more
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> UnsafeUnpin 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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Comparable<K> for Q
impl<Q, K> Comparable<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
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