[][src]Struct mtgapi_client::api::set::filter::SetFilterBuilder

pub struct SetFilterBuilder { /* fields omitted */ }

Builder for filtered set requests

Methods

impl SetFilterBuilder[src]

pub fn build(self) -> SetFilter[src]

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()))

pub fn custom<'a, T>(self, key: T, value: T) -> SetFilterBuilder where
    T: Into<&'a str>, 
[src]

Create a custom filter

let builder = SetFilter::builder();
let filter = builder.custom("name", "Dominaria")
    .build();
assert!(filter == SetFilter("name=Dominaria".to_string()))

pub fn name<'a, T>(self, name: T) -> SetFilterBuilder where
    T: Into<&'a str>, 
[src]

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()))

pub fn names<T>(self, names: &[T]) -> SetFilterBuilder where
    T: Display
[src]

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()));

pub fn block(self, block: SetBlock) -> SetFilterBuilder[src]

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()))

pub fn blocks(self, blocks: &[SetBlock]) -> SetFilterBuilder[src]

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

impl Clone for SetFilterBuilder[src]

impl Debug for SetFilterBuilder[src]

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.