pub struct DisplayBlock {
pub block_type: DisplayBlockType,
pub text: Option<String>,
pub path: Option<String>,
pub old_text: Option<String>,
pub new_text: Option<String>,
pub is_summary: Option<bool>,
pub items: Option<Vec<TodoDisplayItem>>,
pub language: Option<String>,
pub command: Option<String>,
pub data: Option<Value>,
}Expand description
A display block shown to the user in tool results or approval requests.
This struct-based design matches the official Go SDK and avoids tag conflicts when handling unknown block types.
Fields§
§block_type: DisplayBlockTypeBlock type discriminator.
text: Option<String>Text content (used by Brief and Shell).
path: Option<String>File path (used by Diff).
old_text: Option<String>Old text for a diff.
new_text: Option<String>New text for a diff.
is_summary: Option<bool>Whether this diff block is a summary (shows line count instead of actual diff). Added in Wire protocol v1.8.
items: Option<Vec<TodoDisplayItem>>Todo list items.
language: Option<String>Language identifier for syntax highlighting (e.g. “sh”, “powershell”).
command: Option<String>Shell command string.
data: Option<Value>Raw data for unrecognized block types.
Implementations§
Trait Implementations§
Source§impl Clone for DisplayBlock
impl Clone for DisplayBlock
Source§fn clone(&self) -> DisplayBlock
fn clone(&self) -> DisplayBlock
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 DisplayBlock
impl Debug for DisplayBlock
Source§impl<'de> Deserialize<'de> for DisplayBlock
impl<'de> Deserialize<'de> for DisplayBlock
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl PartialEq for DisplayBlock
impl PartialEq for DisplayBlock
Source§fn eq(&self, other: &DisplayBlock) -> bool
fn eq(&self, other: &DisplayBlock) -> bool
Tests for
self and other values to be equal, and is used by ==.Source§impl Serialize for DisplayBlock
impl Serialize for DisplayBlock
impl StructuralPartialEq for DisplayBlock
Auto Trait Implementations§
impl Freeze for DisplayBlock
impl RefUnwindSafe for DisplayBlock
impl Send for DisplayBlock
impl Sync for DisplayBlock
impl Unpin for DisplayBlock
impl UnsafeUnpin for DisplayBlock
impl UnwindSafe for DisplayBlock
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