pub struct SetFilterBuilder { /* private fields */ }
Expand description
Builder for filtered set requests
Implementations§
Source§impl SetFilterBuilder
impl SetFilterBuilder
Sourcepub fn build(self) -> SetFilter
pub fn build(self) -> SetFilter
Creates a Setilter with the specified filter parameters
let builder = SetFilter::builder();
let filter = builder
.name("Khans of Tarkir")
.block(SetBlock::KhansOfTarkir)
.build();
assert!(filter == SetFilter("name=Khans of Tarkir&block=Khans of Tarkir".to_string()))
Sourcepub fn custom<'a, T>(self, key: T, value: T) -> SetFilterBuilder
pub fn custom<'a, T>(self, key: T, value: T) -> SetFilterBuilder
Create a custom filter
let builder = SetFilter::builder();
let filter = builder.custom("name", "Dominaria")
.build();
assert!(filter == SetFilter("name=Dominaria".to_string()))
Sourcepub fn name<'a, T>(self, name: T) -> SetFilterBuilder
pub fn name<'a, T>(self, name: T) -> SetFilterBuilder
Every set that (partially) matches the specified name will match the filter
let builder = SetFilter::builder();
let filter = builder.name("Dominaria")
.build();
assert!(filter == SetFilter("name=Dominaria".to_string()))
Sourcepub fn names<T>(self, names: &[T]) -> SetFilterBuilderwhere
T: Display,
pub fn names<T>(self, names: &[T]) -> SetFilterBuilderwhere
T: Display,
Every set that (partially) matches one of the specified names will match the filter
let builder = SetFilter::builder();
let filter = builder.names(&vec!["Dominaria", "Core Set 2019"])
.build();
assert!(filter == SetFilter("name=Dominaria|Core Set 2019".to_string()));
Sourcepub fn block(self, block: SetBlock) -> SetFilterBuilder
pub fn block(self, block: SetBlock) -> SetFilterBuilder
Every set that (partially) matches the specified block will match the filter
let builder = SetFilter::builder();
let filter = builder.block(SetBlock::Amonkhet)
.build();
assert!(filter == SetFilter("block=Amonkhet".to_string()))
Sourcepub fn blocks(self, blocks: &[SetBlock]) -> SetFilterBuilder
pub fn blocks(self, blocks: &[SetBlock]) -> SetFilterBuilder
Every set that (partially) matches one of the specified blocks will match the filter
let builder = SetFilter::builder();
let filter = builder.blocks(&vec![SetBlock::Amonkhet, SetBlock::Ixalan])
.build();
assert!(filter == SetFilter("block=Amonkhet|Ixalan".to_string()));
Trait Implementations§
Source§impl Clone for SetFilterBuilder
impl Clone for SetFilterBuilder
Source§fn clone(&self) -> SetFilterBuilder
fn clone(&self) -> SetFilterBuilder
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 moreAuto Trait Implementations§
impl Freeze for SetFilterBuilder
impl RefUnwindSafe for SetFilterBuilder
impl Send for SetFilterBuilder
impl Sync for SetFilterBuilder
impl Unpin for SetFilterBuilder
impl UnwindSafe for SetFilterBuilder
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<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> 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