[−]Enum bitboard_xo::XOError
Super Error combining all error in this crate (XOPosError
and XOGameError
)
both XOPosError
and XOGameError
can convert to XOError
with ? operator
use bitboard_xo::XOError; fn main() -> Result<(), XOError> { use bitboard_xo::{XOPos, XO, XOPosError, XOGameError}; // ? auto convert XOPosError to XOError let result_pos: Result<_, XOPosError> = XOPos::col_row(1, 1); let pos: XOPos = result_pos?; // ? auto convert XOGameError to XOError let mut game = XO::new(); let result_win_state: Result<_, XOGameError> = game.play(pos); let win_state = result_win_state?; Ok(()) }
Variants
Fields of PositionError
source: XOPosError
Fields of GameError
source: XOGameError
Trait Implementations
impl Debug for XOError
impl Display for XOError
impl Error for XOError
fn source(&self) -> Option<&(dyn Error + 'static)>
fn backtrace(&self) -> Option<&Backtrace>
[src]
fn description(&self) -> &str
1.0.0[src]
fn cause(&self) -> Option<&dyn Error>
1.0.0[src]
impl From<XOGameError> for XOError
fn from(source: XOGameError) -> Self
impl From<XOPosError> for XOError
fn from(source: XOPosError) -> Self
Auto Trait Implementations
impl RefUnwindSafe for XOError
impl Send for XOError
impl Sync for XOError
impl Unpin for XOError
impl UnwindSafe for XOError
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> ToString for T where
T: Display + ?Sized,
[src]
T: Display + ?Sized,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,