Struct serde_spaniel::prompt::ReplayPrompt
source · [−]pub struct ReplayPrompt<P> { /* private fields */ }
Expand description
Prompt decorator which logs responses and can replay them.
This prompt is used to facilitate undo and restart operations while
interactively deserialising. The deserialiser itself cannot be stepped
backwards once a response has been submitted. It’s necessary to start the
deserialiser again, but the ReplayPrompt
can quickly bring it up to the
correct point by replaying its log.
Implementations
sourceimpl<P> ReplayPrompt<P>
impl<P> ReplayPrompt<P>
pub fn new(inner: P) -> Self
sourcepub fn restart_from(&mut self, n: usize)
pub fn restart_from(&mut self, n: usize)
Truncate the log to the first nth responses in the log.
Trait Implementations
sourceimpl<P: PromptRequester> PromptRequester for ReplayPrompt<P>
impl<P: PromptRequester> PromptRequester for ReplayPrompt<P>
sourcefn is_interactive(&self) -> bool
fn is_interactive(&self) -> bool
Returns true if the prompt is currently interactive.
sourceimpl<P: PromptResponder> PromptResponder for ReplayPrompt<P>
impl<P: PromptResponder> PromptResponder for ReplayPrompt<P>
Auto Trait Implementations
impl<P> RefUnwindSafe for ReplayPrompt<P> where
P: RefUnwindSafe,
impl<P> Send for ReplayPrompt<P> where
P: Send,
impl<P> Sync for ReplayPrompt<P> where
P: Sync,
impl<P> Unpin for ReplayPrompt<P> where
P: Unpin,
impl<P> UnwindSafe for ReplayPrompt<P> where
P: UnwindSafe,
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more