pub struct InputQueue { /* private fields */ }Expand description
Manages input messages during async operations
Implementations§
Source§impl InputQueue
impl InputQueue
pub fn new() -> Self
pub fn with_config(config: QueueConfig) -> Self
pub fn queue_message(&mut self, text: String)
pub fn add_steer(&mut self, text: String)
Sourcepub fn has_queued_messages(&self) -> bool
pub fn has_queued_messages(&self) -> bool
Check if there are any queued messages
Sourcepub fn has_pending_steers(&self) -> bool
pub fn has_pending_steers(&self) -> bool
Check if there are any pending steers
Sourcepub fn queued_count(&self) -> usize
pub fn queued_count(&self) -> usize
Get number of queued messages
Sourcepub fn steer_count(&self) -> usize
pub fn steer_count(&self) -> usize
Get number of pending steers
Sourcepub fn pop_queued(&mut self) -> Option<QueuedMessage>
pub fn pop_queued(&mut self) -> Option<QueuedMessage>
Pop the next queued message (FIFO)
Sourcepub fn queued_texts(&self) -> Vec<String>
pub fn queued_texts(&self) -> Vec<String>
Get all queued message texts for preview
Sourcepub fn steer_texts(&self) -> Vec<String>
pub fn steer_texts(&self) -> Vec<String>
Get all pending steer texts for preview
Sourcepub fn drain_steers(&mut self) -> Vec<QueuedMessage>
pub fn drain_steers(&mut self) -> Vec<QueuedMessage>
Drain all pending steers
Sourcepub fn drain_queued(&mut self) -> Vec<QueuedMessage>
pub fn drain_queued(&mut self) -> Vec<QueuedMessage>
Drain all queued messages
Sourcepub fn pop_last_queued(&mut self) -> Option<QueuedMessage>
pub fn pop_last_queued(&mut self) -> Option<QueuedMessage>
Pop the last queued message for editing
Sourcepub fn set_submit_after_interrupt(&mut self, value: bool)
pub fn set_submit_after_interrupt(&mut self, value: bool)
Mark that next interrupt should submit steers
Sourcepub fn should_submit_after_interrupt(&self) -> bool
pub fn should_submit_after_interrupt(&self) -> bool
Check if should submit steers after interrupt
Sourcepub fn set_suppress_autosend(&mut self, value: bool)
pub fn set_suppress_autosend(&mut self, value: bool)
Set suppress autosend flag
Sourcepub fn is_autosend_suppressed(&self) -> bool
pub fn is_autosend_suppressed(&self) -> bool
Check if autosend is suppressed
Sourcepub fn merge_all(&mut self) -> Option<String>
pub fn merge_all(&mut self) -> Option<String>
Merge all pending messages (steers + queued) into a single text
pub fn save_thread_state(&self) -> Option<ThreadInputState>
pub fn restore_thread_state(&mut self, state: Option<ThreadInputState>)
Trait Implementations§
Source§impl Clone for InputQueue
impl Clone for InputQueue
Source§fn clone(&self) -> InputQueue
fn clone(&self) -> InputQueue
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for InputQueue
impl Debug for InputQueue
Auto Trait Implementations§
impl Freeze for InputQueue
impl RefUnwindSafe for InputQueue
impl Send for InputQueue
impl Sync for InputQueue
impl Unpin for InputQueue
impl UnsafeUnpin for InputQueue
impl UnwindSafe for InputQueue
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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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 moreSource§impl<T> Pointable for T
impl<T> Pointable for T
Source§impl<T> PolicyExt for Twhere
T: ?Sized,
impl<T> PolicyExt for Twhere
T: ?Sized,
Source§impl<R, P> ReadPrimitive<R> for P
impl<R, P> ReadPrimitive<R> for P
Source§fn read_from_little_endian(read: &mut R) -> Result<Self, Error>
fn read_from_little_endian(read: &mut R) -> Result<Self, Error>
Read this value from the supplied reader. Same as
ReadEndian::read_from_little_endian().