pub struct UsiAgent<T, E>where
T: USIPlayer<E> + Debug + Send + 'static,
E: PlayerError,
EventHandlerError<SystemEventKind, E>: From<E>,{ /* private fields */ }Expand description
USIプロトコルをイベントシステムを用いてやり取りするための機能の実装
Implementations§
Source§impl<T, E> UsiAgent<T, E>where
T: USIPlayer<E> + Debug + Send + 'static,
E: PlayerError,
EventHandlerError<SystemEventKind, E>: From<E>,
impl<T, E> UsiAgent<T, E>where
T: USIPlayer<E> + Debug + Send + 'static,
E: PlayerError,
EventHandlerError<SystemEventKind, E>: From<E>,
Sourcepub fn start_default<F>(
&self,
on_error: F,
) -> Result<(), USIAgentRunningError<'_, SystemEventQueue, E>>where
F: FnMut(Option<Arc<Mutex<OnErrorHandler<FileLogger>>>>, &USIAgentRunningError<'_, SystemEventQueue, E>),
pub fn start_default<F>(
&self,
on_error: F,
) -> Result<(), USIAgentRunningError<'_, SystemEventQueue, E>>where
F: FnMut(Option<Arc<Mutex<OnErrorHandler<FileLogger>>>>, &USIAgentRunningError<'_, SystemEventQueue, E>),
デフォルト設定で開始(ログファイルのパスlogs/log.txt,ログをファイルに記録)
§Arguments
on_error- エラー発生時に呼ばれるコールバック関数。エラーオブジェクトへの参照とロガーが渡される。
Sourcepub fn start_with_log_path<F>(
&self,
path: String,
on_error: F,
) -> Result<(), USIAgentRunningError<'_, SystemEventQueue, E>>where
F: FnMut(Option<Arc<Mutex<OnErrorHandler<FileLogger>>>>, &USIAgentRunningError<'_, SystemEventQueue, E>),
pub fn start_with_log_path<F>(
&self,
path: String,
on_error: F,
) -> Result<(), USIAgentRunningError<'_, SystemEventQueue, E>>where
F: FnMut(Option<Arc<Mutex<OnErrorHandler<FileLogger>>>>, &USIAgentRunningError<'_, SystemEventQueue, E>),
Sourcepub fn start<R, W, L, F>(
&self,
reader: R,
writer: W,
logger: L,
on_error: F,
) -> Result<(), USIAgentRunningError<'_, SystemEventQueue, E>>where
R: USIInputReader + Send + 'static,
W: USIOutputWriter + Send + 'static,
L: Logger + Debug + Send + 'static,
F: FnMut(Option<Arc<Mutex<OnErrorHandler<L>>>>, &USIAgentRunningError<'_, SystemEventQueue, E>),
EventHandlerError<SystemEventKind, E>: From<E>,
OnAcceptMove: Send + 'static,
pub fn start<R, W, L, F>(
&self,
reader: R,
writer: W,
logger: L,
on_error: F,
) -> Result<(), USIAgentRunningError<'_, SystemEventQueue, E>>where
R: USIInputReader + Send + 'static,
W: USIOutputWriter + Send + 'static,
L: Logger + Debug + Send + 'static,
F: FnMut(Option<Arc<Mutex<OnErrorHandler<L>>>>, &USIAgentRunningError<'_, SystemEventQueue, E>),
EventHandlerError<SystemEventKind, E>: From<E>,
OnAcceptMove: Send + 'static,
Logger,USIInputReader,USIOutputWriterを指定して開始
§Arguments
reader- 入力を読み取るためのオブジェクト。実装によって標準入力以外から読み取るものを指定することも可能。writer- USIコマンドを出力するためのオブジェクト。実装によって標準出力以外へ書き込むものを指定することも可能。logger- ログを書き込むためのオブジェクト。実装によってファイル以外に書き込むものを指定することも可能。on_error- エラー発生時に呼ばれるコールバック関数。エラーオブジェクトへの参照とロガーが渡される。
Trait Implementations§
Auto Trait Implementations§
impl<T, E> Freeze for UsiAgent<T, E>
impl<T, E> RefUnwindSafe for UsiAgent<T, E>
impl<T, E> !Send for UsiAgent<T, E>
impl<T, E> !Sync for UsiAgent<T, E>
impl<T, E> Unpin for UsiAgent<T, E>
impl<T, E> UnwindSafe for UsiAgent<T, E>
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
Mutably borrows from an owned value. Read more