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 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<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>
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<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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 moreSource§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.