Skip to content

Commit

Permalink
Update docs for engine::Engine
Browse files Browse the repository at this point in the history
  • Loading branch information
bsamseth committed Dec 31, 2023
1 parent a373d49 commit db6c64a
Showing 1 changed file with 9 additions and 6 deletions.
15 changes: 9 additions & 6 deletions goldfish/engine/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,16 @@ use stop_signal::StopSignal;

/// `Engine` implements the `uci::Engine` trait for the Goldfish engine.
///
/// The struct maintains a handle to a search thread, which does the actual work, along
/// with a `StopSignal` which is used to signal the search thread to stop. This is needed as
/// the search needs to happen in a separate thread to the UCI controll loop, but the thread also
/// needs to be held somewhere so as to not drop it.
/// This is the only public type in the crate, as the only intended way to use the engine crate
/// is to provide the `uci::start` function with an instance of this struct.
///
/// The search thread manages by the `Engine` will be given a reference to the `StopSignal`, and
/// promises to check it regularly, stopping the search if it is set.
/// # Examples
/// ```no_run
/// use engine::Engine;
/// use uci::start;
///
/// start(Engine::default()).unwrap();
/// ```
#[derive(Debug, Default)]
pub struct Engine {
stop_signal: StopSignal,
Expand Down

0 comments on commit db6c64a

Please sign in to comment.