pub struct SyncTui { /* private fields */ }Expand description
Terminal user interface for synchronization operations.
SyncTui provides a visual interface for monitoring price data synchronization, including sync
status, price ticks, and price history state. It must be coupled with a SyncEngine before
synchronization begins.
Implementations§
Source§impl SyncTui
impl SyncTui
Sourcepub async fn launch(
config: TuiConfig,
log_file_path: Option<&str>,
) -> Result<Arc<Self>, TuiError>
pub async fn launch( config: TuiConfig, log_file_path: Option<&str>, ) -> Result<Arc<Self>, TuiError>
Launches a new sync TUI with the specified configuration.
Optionally writes TUI logs to a file if log_file_path is provided.
Sourcepub fn couple(&self, engine: SyncEngine) -> Result<(), TuiError>
pub fn couple(&self, engine: SyncEngine) -> Result<(), TuiError>
Couples a SyncEngine to this TUI instance.
This method starts the sync engine and begins listening for sync updates. It can only be called once per TUI instance.
Returns an error if a sync engine has already been coupled.
Sourcepub async fn shutdown(&self) -> Result<(), TuiError>
pub async fn shutdown(&self) -> Result<(), TuiError>
Performs a graceful shutdown of the sync TUI.
This method shuts down the coupled sync engine and stops the UI task. If shutdown does not complete within the configured timeout, the task is aborted.
Returns an error if the TUI is not running or if shutdown fails.
Sourcepub async fn until_stopped(&self) -> Arc<TuiStatusStopped>
pub async fn until_stopped(&self) -> Arc<TuiStatusStopped>
Waits until the TUI has stopped and returns the final stopped status.
This method blocks until the TUI reaches a stopped state, either through graceful shutdown or a crash.
The terminal is automatically restored before this method returns.
Trait Implementations§
Auto Trait Implementations§
impl !Freeze for SyncTui
impl !RefUnwindSafe for SyncTui
impl Send for SyncTui
impl Sync for SyncTui
impl Unpin for SyncTui
impl !UnwindSafe for SyncTui
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
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more