pub fn with_cart(cart: Cart) -> Box<Mapper> {
        match cart.mapper {
            MapperID::M1 => Box::new(mapper1::Mapper1::new(cart)),
            MapperID::M2 => Box::new(mapper2::Mapper2::new(cart)),
        }
    }
/// Dynamically assigns the correct mapper based on the cart.
/// Returns an error if the mapper is unkown
Dynamically assigns the correct mapper based on the cart.
Returns an error if the mapper is unkown
Dynamically assigns the correct mapper based on the cart . Returns an error if the mapper is unkown
pub fn with_cart(cart: Cart) -> Box<Mapper> {
        match cart.mapper {
            MapperID::M1 => Box::new(mapper1::Mapper1::new(cart)),
            MapperID::M2 => Box::new(mapper2::Mapper2::new(cart)),
        }
    }
pub fn with_cart ( cart : Cart ) -> Box < Mapper > { match cart . mapper { MapperID :: M1 => Box :: new ( mapper1 :: Mapper1 :: new ( cart ) ) , MapperID :: M2 => Box :: new ( mapper2 :: Mapper2 :: new ( cart ) ) , } }
Dynamically assigns the correct mapper based on the cart.
Dynamically assigns the correct mapper based on the cart .
cart
Cart
cart
Cart