pub struct OutputSnapshot { /* private fields */ }Expand description
Snapshot of terminal output zones, excluding prompt input/history state.
Implementations§
Source§impl OutputSnapshot
impl OutputSnapshot
Sourcepub fn block_count(&self) -> usize
pub fn block_count(&self) -> usize
Returns the number of blocks retained by this presentation model.
Sourcepub fn suggestion_ids(&self) -> &[BlockId]
pub fn suggestion_ids(&self) -> &[BlockId]
Returns the ordered block ids currently present in the suggestions zone.
Sourcepub fn new_block(
&mut self,
debug_id: impl Into<String>,
block: impl Into<StyledBlock>,
) -> BlockId
pub fn new_block( &mut self, debug_id: impl Into<String>, block: impl Into<StyledBlock>, ) -> BlockId
Allocates and stores a block in this output snapshot.
Sourcepub fn set_block(&mut self, id: BlockId, block: impl Into<StyledBlock>)
pub fn set_block(&mut self, id: BlockId, block: impl Into<StyledBlock>)
Replaces one block in this output snapshot.
Sourcepub fn remove_block(&mut self, id: BlockId)
pub fn remove_block(&mut self, id: BlockId)
Removes one block and all of its zone references.
Sourcepub fn push_history(&mut self, id: BlockId)
pub fn push_history(&mut self, id: BlockId)
Appends a block to snapshot history.
Sourcepub fn push_above_active(&mut self, id: BlockId)
pub fn push_above_active(&mut self, id: BlockId)
Appends a block to the snapshot active zone.
Sourcepub fn push_above_active_before_any<I>(&mut self, id: BlockId, anchors: I)where
I: IntoIterator<Item = BlockId>,
pub fn push_above_active_before_any<I>(&mut self, id: BlockId, anchors: I)where
I: IntoIterator<Item = BlockId>,
Moves a block before the first matching snapshot active-zone anchor.
Sourcepub fn push_above_sticky(&mut self, id: BlockId)
pub fn push_above_sticky(&mut self, id: BlockId)
Appends a block to the snapshot sticky zone.
Sourcepub fn remove_above_sticky(&mut self, id: BlockId)
pub fn remove_above_sticky(&mut self, id: BlockId)
Removes a block reference from the snapshot sticky zone.
Sourcepub fn push_below(&mut self, id: BlockId)
pub fn push_below(&mut self, id: BlockId)
Appends a block to the snapshot below-prompt zone.
Sourcepub fn print_output(
&mut self,
debug_id: impl Into<String>,
block: impl Into<StyledBlock>,
) -> BlockId
pub fn print_output( &mut self, debug_id: impl Into<String>, block: impl Into<StyledBlock>, ) -> BlockId
Creates and appends one snapshot history block.
Trait Implementations§
Source§impl Clone for OutputSnapshot
impl Clone for OutputSnapshot
Source§fn clone(&self) -> OutputSnapshot
fn clone(&self) -> OutputSnapshot
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · 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 OutputSnapshot
impl Debug for OutputSnapshot
Source§impl Default for OutputSnapshot
impl Default for OutputSnapshot
Source§fn default() -> OutputSnapshot
fn default() -> OutputSnapshot
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for OutputSnapshot
impl RefUnwindSafe for OutputSnapshot
impl Send for OutputSnapshot
impl Sync for OutputSnapshot
impl Unpin for OutputSnapshot
impl UnsafeUnpin for OutputSnapshot
impl UnwindSafe for OutputSnapshot
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