pub struct Builder(/* private fields */);Expand description
A loose deal builder — any combination of four hands, no invariants
Use Builder to construct a deal incrementally. Convert it into a
PartialDeal or FullDeal (via the inherent build_partial /
build_full methods, or via TryFrom) once the hands are finalized.
Builder is the only deal type that exposes IndexMut
for in-place mutation.
Implementations§
Source§impl Builder
impl Builder
Sourcepub const fn north(self, hand: Hand) -> Self
pub const fn north(self, hand: Hand) -> Self
Set the hand at Seat::North
Sourcepub const fn east(self, hand: Hand) -> Self
pub const fn east(self, hand: Hand) -> Self
Set the hand at Seat::East
Sourcepub const fn south(self, hand: Hand) -> Self
pub const fn south(self, hand: Hand) -> Self
Set the hand at Seat::South
Sourcepub const fn west(self, hand: Hand) -> Self
pub const fn west(self, hand: Hand) -> Self
Set the hand at Seat::West
Sourcepub fn build_partial(self) -> Result<PartialDeal, Self>
pub fn build_partial(self) -> Result<PartialDeal, Self>
Try to convert this builder into a PartialDeal, validating that each
hand has at most 13 cards and the hands are pairwise disjoint. On
failure the input is returned unchanged as the error.
§Errors
Returns self unchanged if the builder is not a valid subset.
Sourcepub fn build_full(self) -> Result<FullDeal, Self>
pub fn build_full(self) -> Result<FullDeal, Self>
Trait Implementations§
Source§impl From<Builder> for ddTableDeal
FFI converter for a Builder. Used internally by FullDeal and
PartialDeal converters; Builder itself is unvalidated so prefer those.
impl From<Builder> for ddTableDeal
FFI converter for a Builder. Used internally by FullDeal and
PartialDeal converters; Builder itself is unvalidated so prefer those.