[][src]Trait rubot::IntoRunCondition

pub trait IntoRunCondition {
    type RunCondition: RunCondition;
    fn into_run_condition(self) -> Self::RunCondition;
}

Converts a type into a RunCondition used by Bot::select. It is recommended to mostly use Duration.

Examples

use std::time::Duration;

let available_time = Duration::from_secs(2);

let game: Game = // ...
let mut bot: Bot = // ...
assert!(bot.select(&game, available_time).is_some())

Implementations

  • Duration: select runs for the specified duration
  • ToCompletion: select runs until it found the perfect action
  • Depth: select analyses up the to given depth and returns to best action at that depth
  • Instant: select runs until the given Instant is in the past
  • Logger: takes another run condition and stores information about the last call to select

Associated Types

Loading content...

Required methods

fn into_run_condition(self) -> Self::RunCondition

consumes self and returns a RunCondition.

Loading content...

Implementations on Foreign Types

impl IntoRunCondition for Duration[src]

Creates a RunCondition which returns true until this Duration has passed.

Loading content...

Implementors

impl IntoRunCondition for Steps[src]

type RunCondition = InnerSteps

impl<'a, T: IntoRunCondition> IntoRunCondition for &'a mut Logger<T>[src]

type RunCondition = InnerLogger<'a, T>

impl<T> IntoRunCondition for T where
    T: RunCondition
[src]

type RunCondition = Self

Loading content...