Struct onejoker::poker::hand_value::HandDescriptionBuilder
source · pub struct HandDescriptionBuilder { /* private fields */ }
Expand description
wiki | Builder for hand description
Builder for new HandDescription objects. Does some error checking while allowing construction im multiple ways.
use onejoker::prelude::*;
use onejoker::poker::HandDescriptionBuilder;
let hand = Hand::new(DeckType::English).init(hand!("As","Js","Ts","7s","5s"));
let v = HandDescriptionBuilder::new(&hand, Scale::HighHand)
.with_level(HandLevel::Flush)
.with_default_value().complete();
Implementations§
source§impl HandDescriptionBuilder
impl HandDescriptionBuilder
sourcepub fn with_level(self, level: HandLevel) -> Self
pub fn with_level(self, level: HandLevel) -> Self
Set the level of the hand
sourcepub fn with_value(self, value: HandValue) -> Self
pub fn with_value(self, value: HandValue) -> Self
Set the value of the hand to a custom number
sourcepub fn with_default_value(self) -> Self
pub fn with_default_value(self) -> Self
Set the value of the hand using the default calculation
sourcepub fn complete(self) -> Result<HandDescription>
pub fn complete(self) -> Result<HandDescription>
Finish building the HandDescription object
Auto Trait Implementations§
impl Freeze for HandDescriptionBuilder
impl RefUnwindSafe for HandDescriptionBuilder
impl Send for HandDescriptionBuilder
impl Sync for HandDescriptionBuilder
impl Unpin for HandDescriptionBuilder
impl UnwindSafe for HandDescriptionBuilder
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more