Enum ci_manager::ci_provider::util::LabelFilter
source · pub enum LabelFilter<I, S>{
Any(I),
All(I),
None(PhantomData<I>),
}Expand description
Filter an element by its labels. This is a type-safe way to create a filter string for the GitHub API.
§Example
// Get elements with the label "bug"
let label_filter = LabelFilter::Any(["bug"]);
assert_eq!(label_filter.to_string(), r#"label:"bug""#);// Only get elements with the labels "bug" and "help wanted"
let label_filter = LabelFilter::All(["bug", "help wanted"]);
assert_eq!(label_filter.to_string(), r#"label:"bug" label:"help wanted""#);// Do not filter by labels
let label_filter = LabelFilter::none();
assert_eq!(label_filter.to_string(), "");Variants§
Any(I)
Any of the labels must be present.
All(I)
All labels must be present.
None(PhantomData<I>)
No label filter.
§Note: Use the none() method to create this variant.
Or deal with the type complexity manually :).
Implementations§
Trait Implementations§
source§impl<I, S> Clone for LabelFilter<I, S>
impl<I, S> Clone for LabelFilter<I, S>
source§fn clone(&self) -> LabelFilter<I, S>
fn clone(&self) -> LabelFilter<I, S>
Returns a copy 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<I, S> Debug for LabelFilter<I, S>
impl<I, S> Debug for LabelFilter<I, S>
source§impl<I, S> Display for LabelFilter<I, S>
impl<I, S> Display for LabelFilter<I, S>
source§impl<I, S> PartialEq for LabelFilter<I, S>
impl<I, S> PartialEq for LabelFilter<I, S>
source§fn eq(&self, other: &LabelFilter<I, S>) -> bool
fn eq(&self, other: &LabelFilter<I, S>) -> bool
This method tests for
self and other values to be equal, and is used
by ==.impl<I, S> Eq for LabelFilter<I, S>
impl<I, S> StructuralPartialEq for LabelFilter<I, S>
Auto Trait Implementations§
impl<I, S> Freeze for LabelFilter<I, S>where
I: Freeze,
impl<I, S> RefUnwindSafe for LabelFilter<I, S>where
I: RefUnwindSafe,
impl<I, S> Send for LabelFilter<I, S>where
I: Send,
impl<I, S> Sync for LabelFilter<I, S>where
I: Sync,
impl<I, S> Unpin for LabelFilter<I, S>where
I: Unpin,
impl<I, S> UnwindSafe for LabelFilter<I, S>where
I: UnwindSafe,
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<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> PolicyExt for Twhere
T: ?Sized,
impl<T> PolicyExt for Twhere
T: ?Sized,
source§impl<T> ToStringFallible for Twhere
T: Display,
impl<T> ToStringFallible for Twhere
T: Display,
source§fn try_to_string(&self) -> Result<String, TryReserveError>
fn try_to_string(&self) -> Result<String, TryReserveError>
ToString::to_string, but without panic on OOM.