pub struct SemanticZone {
pub id: u64,
pub zone_type: ZoneType,
pub start_row: u32,
pub end_row: u32,
pub command: Option<String>,
pub exit_code: Option<i32>,
pub started_at: u64,
pub duration_micros: Option<u64>,
pub is_complete: bool,
}Expand description
A semantic zone representing a region between shell integration markers
Zones are created by correlating OSC 133 markers:
- Prompt: From A marker to B marker
- Input: From B marker to C marker
- Output: From C marker to D marker
Fields§
§id: u64Unique identifier for this zone
zone_type: ZoneTypeType of zone
start_row: u32Starting line number (absolute, including scrollback)
end_row: u32Ending line number (absolute, including scrollback) For incomplete zones (e.g., still outputting), this may equal start_row
command: Option<String>Command text extracted from the input zone (if available)
exit_code: Option<i32>Exit code from OSC 133;D marker (only for completed output zones)
started_at: u64Timestamp when the zone started (microseconds since UNIX epoch)
duration_micros: Option<u64>Duration in microseconds (only for completed zones)
is_complete: boolWhether this zone is complete (has an end marker)
Implementations§
Source§impl SemanticZone
impl SemanticZone
Sourcepub fn new_prompt(id: u64, start_row: u32, timestamp: u64) -> Self
pub fn new_prompt(id: u64, start_row: u32, timestamp: u64) -> Self
Create a new prompt zone
Sourcepub fn new_output(id: u64, start_row: u32, timestamp: u64) -> Self
pub fn new_output(id: u64, start_row: u32, timestamp: u64) -> Self
Create a new output zone
Sourcepub fn complete(&mut self, end_row: u32, end_timestamp: u64)
pub fn complete(&mut self, end_row: u32, end_timestamp: u64)
Mark this zone as complete with an ending row and timestamp
Sourcepub fn set_command(&mut self, command: String)
pub fn set_command(&mut self, command: String)
Set the command text for this zone (typically for input zones)
Sourcepub fn set_exit_code(&mut self, exit_code: i32)
pub fn set_exit_code(&mut self, exit_code: i32)
Set the exit code (only for output zones)
Sourcepub fn contains_line(&self, line: u32) -> bool
pub fn contains_line(&self, line: u32) -> bool
Check if this zone contains the given line number
Sourcepub fn line_count(&self) -> u32
pub fn line_count(&self) -> u32
Get the number of lines in this zone
Sourcepub fn is_success(&self) -> bool
pub fn is_success(&self) -> bool
Check if this zone represents a successful command (exit code 0)
Sourcepub fn is_failure(&self) -> bool
pub fn is_failure(&self) -> bool
Check if this zone represents a failed command (non-zero exit code)
Sourcepub fn duration_millis(&self) -> Option<u64>
pub fn duration_millis(&self) -> Option<u64>
Get duration in milliseconds for display
Sourcepub fn duration_secs(&self) -> Option<f64>
pub fn duration_secs(&self) -> Option<f64>
Get duration in seconds for display
Trait Implementations§
Source§impl Archive for SemanticZone
impl Archive for SemanticZone
Source§type Archived = ArchivedSemanticZone
type Archived = ArchivedSemanticZone
Source§type Resolver = SemanticZoneResolver
type Resolver = SemanticZoneResolver
Source§impl Clone for SemanticZone
impl Clone for SemanticZone
Source§fn clone(&self) -> SemanticZone
fn clone(&self) -> SemanticZone
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for SemanticZone
impl Debug for SemanticZone
Source§impl<__D: Fallible + ?Sized> Deserialize<SemanticZone, __D> for Archived<SemanticZone>where
u64: Archive,
Archived<u64>: Deserialize<u64, __D>,
ZoneType: Archive,
Archived<ZoneType>: Deserialize<ZoneType, __D>,
u32: Archive,
Archived<u32>: Deserialize<u32, __D>,
Option<String>: Archive,
Archived<Option<String>>: Deserialize<Option<String>, __D>,
Option<i32>: Archive,
Archived<Option<i32>>: Deserialize<Option<i32>, __D>,
Option<u64>: Archive,
Archived<Option<u64>>: Deserialize<Option<u64>, __D>,
bool: Archive,
Archived<bool>: Deserialize<bool, __D>,
impl<__D: Fallible + ?Sized> Deserialize<SemanticZone, __D> for Archived<SemanticZone>where
u64: Archive,
Archived<u64>: Deserialize<u64, __D>,
ZoneType: Archive,
Archived<ZoneType>: Deserialize<ZoneType, __D>,
u32: Archive,
Archived<u32>: Deserialize<u32, __D>,
Option<String>: Archive,
Archived<Option<String>>: Deserialize<Option<String>, __D>,
Option<i32>: Archive,
Archived<Option<i32>>: Deserialize<Option<i32>, __D>,
Option<u64>: Archive,
Archived<Option<u64>>: Deserialize<Option<u64>, __D>,
bool: Archive,
Archived<bool>: Deserialize<bool, __D>,
Source§fn deserialize(
&self,
deserializer: &mut __D,
) -> Result<SemanticZone, __D::Error>
fn deserialize( &self, deserializer: &mut __D, ) -> Result<SemanticZone, __D::Error>
Auto Trait Implementations§
impl Freeze for SemanticZone
impl RefUnwindSafe for SemanticZone
impl Send for SemanticZone
impl Sync for SemanticZone
impl Unpin for SemanticZone
impl UnsafeUnpin for SemanticZone
impl UnwindSafe for SemanticZone
Blanket Implementations§
Source§impl<T> ArchivePointee for T
impl<T> ArchivePointee for T
Source§type ArchivedMetadata = ()
type ArchivedMetadata = ()
Source§fn pointer_metadata(
_: &<T as ArchivePointee>::ArchivedMetadata,
) -> <T as Pointee>::Metadata
fn pointer_metadata( _: &<T as ArchivePointee>::ArchivedMetadata, ) -> <T as Pointee>::Metadata
Source§impl<T> ArchiveUnsized for Twhere
T: Archive,
impl<T> ArchiveUnsized for Twhere
T: Archive,
Source§type Archived = <T as Archive>::Archived
type Archived = <T as Archive>::Archived
Archive, it may be unsized. Read more