[−][src]Struct connect6::policy::IoPolicy
Policy for in-game user selection with io
Input format is {row lowercase}{col uppercase} such as "sS" or "aC". If invalid format or position is given, policy will write retrying message to stdout.
Note if given position raise Err from Game, game will be terminated by Agent
.
Note We suggest that if you use IoPolicy, construct Agent
with Agent::debug
.
IoPolicy doesn't displaying the board when you make the choice,
so that if you want to confirm the board, you have to construct Agent
in debug mode.
Examples
ⓘThis example is not tested
io_policy_stdio!(io_policy); Agent::debug(&mut io_policy).play().unwrap();
Methods
impl<'a, 'b> IoPolicy<'a, 'b>
[src]
pub fn new(
reader: &'a mut dyn Read,
writer: &'b mut dyn Write
) -> IoPolicy<'a, 'b>
[src]
reader: &'a mut dyn Read,
writer: &'b mut dyn Write
) -> IoPolicy<'a, 'b>
Construct a new IoPolicy
Examples
let mut stdin = std::io::stdin(); let mut stdout = std::io::stdout(); let mut io_policy = IoPolicy::new(&mut stdin, &mut stdout);
Trait Implementations
Auto Trait Implementations
Blanket Implementations
impl<T> From for T
[src]
impl<T, U> Into for T where
U: From<T>,
[src]
U: From<T>,
impl<T, U> TryFrom for T where
T: From<U>,
[src]
T: From<U>,
type Error = !
🔬 This is a nightly-only experimental API. (
try_from
)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> Borrow for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T, U> TryInto for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
🔬 This is a nightly-only experimental API. (
try_from
)The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,