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

pub struct SetFilterBuilder { /* fields omitted */ }

Builder for filtered set requests

Methods

impl SetFilterBuilder
[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()))

Create a custom filter

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

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

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

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

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]

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

impl Debug for SetFilterBuilder
[src]

Formats the value using the given formatter. Read more

Auto Trait Implementations