Expand description
Bidding, penalties, and scoring in contract bridge.
Level wraps a 1..=7 contract level, Bid pairs a level with a
Strain, and Contract adds a Penalty (undoubled, doubled,
redoubled). Contract::score returns the duplicate score for a given
trick count and vulnerability.
§Panic policy
The safe constructors that take raw levels — Level::new, Bid::new,
and Contract::new — panic when the level is outside 1..=7, and have
Level::try_new for fallible construction. In const contexts the panic
becomes a compile-time error.
Structs§
- Bid
- A call that proposes a contract
- Contract
- The statement of the pair winning the bidding that they will take at least the number of tricks (in addition to the book of 6 tricks), and the strain denotes the trump suit.
- Invalid
Level - Error indicating an invalid level
- Level
- The level of a contract, from 1 to 7
- Parse
BidError - Error returned when parsing a
Bidfails - Parse
Contract Error - Error returned when parsing a
Contractfails - Parse
Level Error - Error returned when parsing a
Levelfails - Parse
Penalty Error - Error returned when parsing
Penaltyfails
Enums§
- Penalty
- Penalty inflicted on a contract