pub struct HistoryManager<T: Clone> { /* private fields */ }
Expand description
历史管理器
Implementations§
Source§impl<T: Clone> HistoryManager<T>
impl<T: Clone> HistoryManager<T>
Sourcepub fn with_config(initial_state: T, config: HistoryConfig) -> Self
pub fn with_config(initial_state: T, config: HistoryConfig) -> Self
使用配置创建历史管理器
Sourcepub fn get_present(&self) -> T
pub fn get_present(&self) -> T
获取当前状态
Sourcepub fn get_history(&self) -> &History<T>
pub fn get_history(&self) -> &History<T>
获取历史记录
Sourcepub fn get_history_length(&self) -> usize
pub fn get_history_length(&self) -> usize
获取历史记录长度
Sourcepub fn get_config(&self) -> &HistoryConfig
pub fn get_config(&self) -> &HistoryConfig
获取历史配置
Sourcepub fn update_config(&mut self, config: HistoryConfig)
pub fn update_config(&mut self, config: HistoryConfig)
更新历史配置
Sourcepub fn jump_to_future(&mut self, index: usize)
pub fn jump_to_future(&mut self, index: usize)
Sourcepub fn jump_to_past(&mut self, index: usize)
pub fn jump_to_past(&mut self, index: usize)
Sourcepub fn clear_history(&mut self)
pub fn clear_history(&mut self)
清空历史记录
Sourcepub fn past_count(&self) -> usize
pub fn past_count(&self) -> usize
获取过去状态的数量
Sourcepub fn future_count(&self) -> usize
pub fn future_count(&self) -> usize
获取未来状态的数量
Sourcepub fn validate_integrity(&self) -> bool
pub fn validate_integrity(&self) -> bool
验证历史记录的完整性
用于调试和测试,确保历史记录结构正确
Auto Trait Implementations§
impl<T> Freeze for HistoryManager<T>where
T: Freeze,
impl<T> RefUnwindSafe for HistoryManager<T>where
T: RefUnwindSafe,
impl<T> Send for HistoryManager<T>where
T: Send,
impl<T> Sync for HistoryManager<T>where
T: Sync,
impl<T> Unpin for HistoryManager<T>where
T: Unpin,
impl<T> UnwindSafe for HistoryManager<T>where
T: UnwindSafe,
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
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>
Converts
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>
Converts
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