#[non_exhaustive]pub enum TrainerError {
Board(BoardError),
TreeBoardMismatch,
InvalidTree {
reason: &'static str,
},
EmptyRange {
player: Player,
},
InvalidCombo {
player: Player,
index: usize,
},
DuplicateCombo {
player: Player,
index: usize,
},
ComboConflictsWithBoard {
player: Player,
index: usize,
},
InvalidWeight {
player: Player,
index: usize,
},
NoCompatibleDeals,
ZeroBuckets,
AsymmetricRange {
player: Player,
},
}Expand description
Why Trainer::new rejected its inputs.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Board(BoardError)
The tree’s board is not a legal flop, turn, or river.
TreeBoardMismatch
The tree’s nodes do not continue from its board: they reach a showdown before the river, or deal a card past the river.
InvalidTree
The tree is malformed: decision ids are not exactly
0..num_decision_nodes, actions and children differ in length, a
chance node does not deal every undealt card exactly once or groups
cards that are not suit swaps of each other, or a terminal investment
is negative or not finite.
EmptyRange
A player’s range has no combo with positive weight.
InvalidCombo
A combo holds the same card twice.
Fields
DuplicateCombo
A combo appears more than once in the same range.
Fields
ComboConflictsWithBoard
A combo uses a card that is already on the initial board.
Pass the board as dead cards to Range::combos.
Fields
InvalidWeight
A combo weight is negative or not finite.
Fields
NoCompatibleDeals
Every pair of positive-weight combos shares a card, so no deal is possible and every value would be undefined.
ZeroBuckets
A CardAbstraction street asks for zero buckets.
AsymmetricRange
A range is not closed under the initial board’s free-suit swaps.
This is required when the tree groups chance cards by suit isomorphism (with equal weights for swapped combos) or when flop or turn buckets are on.
Trait Implementations§
Source§impl Clone for TrainerError
impl Clone for TrainerError
Source§impl Debug for TrainerError
impl Debug for TrainerError
Source§impl Display for TrainerError
impl Display for TrainerError
impl Eq for TrainerError
Source§impl Error for TrainerError
impl Error for TrainerError
Source§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
1.0.0 · Source§fn description(&self) -> &str
fn description(&self) -> &str
use the Display impl or to_string()
Source§impl From<BoardError> for TrainerError
impl From<BoardError> for TrainerError
Source§fn from(error: BoardError) -> Self
fn from(error: BoardError) -> Self
Source§impl PartialEq for TrainerError
impl PartialEq for TrainerError
impl StructuralPartialEq for TrainerError
Auto Trait Implementations§
impl Freeze for TrainerError
impl RefUnwindSafe for TrainerError
impl Send for TrainerError
impl Sync for TrainerError
impl Unpin for TrainerError
impl UnsafeUnpin for TrainerError
impl UnwindSafe for TrainerError
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more