pub struct SetQuery<'a> { /* private fields */ }Expand description
Query interface for MTG sets backed by the sets parquet view.
Implementations§
Source§impl<'a> SetQuery<'a>
impl<'a> SetQuery<'a>
Sourcepub fn new(conn: &'a Connection) -> Self
pub fn new(conn: &'a Connection) -> Self
Create a new SetQuery bound to the given connection.
Sourcepub fn get(&self, code: &str) -> Result<Option<Value>>
pub fn get(&self, code: &str) -> Result<Option<Value>>
Get a single set by its code (case-insensitive – uppercased before lookup).
Sourcepub fn list(
&self,
set_type: Option<&str>,
name: Option<&str>,
limit: Option<usize>,
offset: Option<usize>,
) -> Result<Vec<Value>>
pub fn list( &self, set_type: Option<&str>, name: Option<&str>, limit: Option<usize>, offset: Option<usize>, ) -> Result<Vec<Value>>
List all sets ordered by release date (descending).
Supports optional filtering by set_type and name (substring match), plus
limit / offset pagination.
Sourcepub fn search(&self, params: &SearchSetsParams) -> Result<Vec<Value>>
pub fn search(&self, params: &SearchSetsParams) -> Result<Vec<Value>>
Search sets using a combination of filters.
name: substring LIKE matchset_type: exact match ontypeblock: exact match onblockrelease_year: matches the year portion ofreleaseDate
Sourcepub fn get_financial_summary(
&self,
set_code: &str,
provider: Option<&str>,
currency: Option<&str>,
finish: Option<&str>,
price_type: Option<&str>,
) -> Result<HashMap<String, Value>>
pub fn get_financial_summary( &self, set_code: &str, provider: Option<&str>, currency: Option<&str>, finish: Option<&str>, price_type: Option<&str>, ) -> Result<HashMap<String, Value>>
Get a financial summary for the given set code.
Requires the all_prices_today view to be available.
Returns a map with keys: card_count, total_value, avg_value,
min_value, max_value, date.
§Arguments
set_code- The set code (case-insensitive).provider- Price provider (default"tcgplayer").currency- Currency code (default"USD").finish- Card finish (default"normal").price_type- Price type (default"retail").
Auto Trait Implementations§
impl<'a> !RefUnwindSafe for SetQuery<'a>
impl<'a> !Send for SetQuery<'a>
impl<'a> !Sync for SetQuery<'a>
impl<'a> !UnwindSafe for SetQuery<'a>
impl<'a> Freeze for SetQuery<'a>
impl<'a> Unpin for SetQuery<'a>
impl<'a> UnsafeUnpin for SetQuery<'a>
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