When the trading process is characterized by search frictions, traders may be rationed so markets need not clear. We argue that rationing can be part of general equilibrium, even if it is outside its normal interpretation. We build a general equilibrium model where the uncertainty arising from rationing is incorporated in the definition of a commodity, in the spirit of the Arrow- Debreu theory. Prices of commodities then depend not only on their physical characteristics, but also on the probability that their trade is rationed. The standard definition of a competitive equilibrium is extended by replacing market clearing with a matching condition. This condition relates the traders' rationing probabilities to the measures of buyers and sellers in the market via an exogenous matching function, as in the search models of Diamond (1982a, 1982b), Mortensen (1982a, 1982b) and Pissarides (1984, 1985). When search frictions vanish (so matching is frictionless) our model is equivalent to the competitive assignment model of Gretsky, Ostroy and Zame (1992, 1999). We adopt their linear programming approach to derive the welfare and existence theorems in our environment.