fn card(ctx: &Context, oracle_id: Option<Uuid>, name: Option<String>) -> Option<Card> {
        if let Some(id) = oracle_id {
            use crate::schema::cards::dsl::scryfalloracleid;
            let conn = ctx.pool.get().expect("Unable to get DB connection.");

            find_card(&conn, scryfalloracleid.eq(id))
        } else if let Some(name) = name {
            use crate::schema::cards::dsl::name as name_;
            let conn = ctx.pool.get().unwrap();

            find_card(&conn, name_.eq(name))
        } else {
            None
        }
    }
/// Lookup a single card by its Scryfall Oracle ID or its Name.
Lookup a single card by its Scryfall Oracle ID or its Name.
Lookup a single card by its Scryfall Oracle ID or its Name .
fn card(ctx: &Context, oracle_id: Option<Uuid>, name: Option<String>) -> Option<Card> {
        if let Some(id) = oracle_id {
            use crate::schema::cards::dsl::scryfalloracleid;
            let conn = ctx.pool.get().expect("Unable to get DB connection.");
            find_card(&conn, scryfalloracleid.eq(id))
        } else if let Some(name) = name {
            use crate::schema::cards::dsl::name as name_;
            let conn = ctx.pool.get().unwrap();
            find_card(&conn, name_.eq(name))
        } else {
            None
        }
    }
fn card ( ctx : & Context , oracle_id : Option < Uuid > , name : Option < String > ) -> Option < Card > { if let Some ( id ) = oracle_id { use crate :: schema :: cards :: dsl :: scryfalloracleid ; let conn = ctx . pool . get ( ) . expect ( " " ) ; find_card ( & conn , scryfalloracleid . eq ( id ) ) } else if let Some ( name ) = name { use crate :: schema :: cards :: dsl :: name as name_ ; let conn = ctx . pool . get ( ) . unwrap ( ) ; find_card ( & conn , name_ . eq ( name ) ) } else { None } }
Lookup a single card by its Scryfall Oracle ID or its Name.
Lookup a single card by its Scryfall Oracle ID or its Name .
ctx
&Context
oracle_id
Option<Uuid>
name
Option<String>
ctx
&Context
oracle_id
Option<Uuid>
name
Option<String>