pub struct CommandBlock {
pub id: u64,
pub prompt_zone: Option<SemanticZone>,
pub input_zone: Option<SemanticZone>,
pub output_zone: Option<SemanticZone>,
pub start_row: u32,
pub end_row: u32,
pub started_at: u64,
pub duration_micros: Option<u64>,
}Expand description
A command block represents a complete prompt-input-output sequence
This is a higher-level abstraction that groups related zones together for easier reasoning about commands and their results.
Fields§
§id: u64Unique identifier
prompt_zone: Option<SemanticZone>Prompt zone
input_zone: Option<SemanticZone>Input zone
output_zone: Option<SemanticZone>Output zone
start_row: u32Starting line of the entire block
end_row: u32Ending line of the entire block
started_at: u64Timestamp when the command started
duration_micros: Option<u64>Total duration from prompt to command completion
Implementations§
Source§impl CommandBlock
impl CommandBlock
Sourcepub fn new(id: u64, prompt_zone: SemanticZone) -> Self
pub fn new(id: u64, prompt_zone: SemanticZone) -> Self
Create a new command block starting with a prompt zone
Sourcepub fn add_input_zone(&mut self, zone: SemanticZone)
pub fn add_input_zone(&mut self, zone: SemanticZone)
Add an input zone to this command block
Sourcepub fn add_output_zone(&mut self, zone: SemanticZone)
pub fn add_output_zone(&mut self, zone: SemanticZone)
Add an output zone to this command block
Sourcepub fn command_text(&self) -> Option<&str>
pub fn command_text(&self) -> Option<&str>
Get the command text from the input zone
Sourcepub fn is_complete(&self) -> bool
pub fn is_complete(&self) -> bool
Check if this command block is complete (has all zones)
Sourcepub fn is_success(&self) -> bool
pub fn is_success(&self) -> bool
Check if this command was successful
Sourcepub fn is_failure(&self) -> bool
pub fn is_failure(&self) -> bool
Check if this command failed
Sourcepub fn output_bounds(&self) -> Option<(u32, u32)>
pub fn output_bounds(&self) -> Option<(u32, u32)>
Get the output zone bounds for text extraction
Sourcepub fn contains_line(&self, line: u32) -> bool
pub fn contains_line(&self, line: u32) -> bool
Check if this block contains the given line
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 CommandBlock
impl Archive for CommandBlock
Source§type Archived = ArchivedCommandBlock
type Archived = ArchivedCommandBlock
Source§type Resolver = CommandBlockResolver
type Resolver = CommandBlockResolver
Source§impl Clone for CommandBlock
impl Clone for CommandBlock
Source§fn clone(&self) -> CommandBlock
fn clone(&self) -> CommandBlock
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for CommandBlock
impl Debug for CommandBlock
Source§impl<__D: Fallible + ?Sized> Deserialize<CommandBlock, __D> for Archived<CommandBlock>where
u64: Archive,
Archived<u64>: Deserialize<u64, __D>,
Option<SemanticZone>: Archive,
Archived<Option<SemanticZone>>: Deserialize<Option<SemanticZone>, __D>,
u32: Archive,
Archived<u32>: Deserialize<u32, __D>,
Option<u64>: Archive,
Archived<Option<u64>>: Deserialize<Option<u64>, __D>,
impl<__D: Fallible + ?Sized> Deserialize<CommandBlock, __D> for Archived<CommandBlock>where
u64: Archive,
Archived<u64>: Deserialize<u64, __D>,
Option<SemanticZone>: Archive,
Archived<Option<SemanticZone>>: Deserialize<Option<SemanticZone>, __D>,
u32: Archive,
Archived<u32>: Deserialize<u32, __D>,
Option<u64>: Archive,
Archived<Option<u64>>: Deserialize<Option<u64>, __D>,
Source§fn deserialize(
&self,
deserializer: &mut __D,
) -> Result<CommandBlock, __D::Error>
fn deserialize( &self, deserializer: &mut __D, ) -> Result<CommandBlock, __D::Error>
Auto Trait Implementations§
impl Freeze for CommandBlock
impl RefUnwindSafe for CommandBlock
impl Send for CommandBlock
impl Sync for CommandBlock
impl Unpin for CommandBlock
impl UnsafeUnpin for CommandBlock
impl UnwindSafe for CommandBlock
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