pub struct StreamEvent {
pub event: String,
pub data: String,
pub block_index: Option<i64>,
pub block_type: Option<String>,
pub ephemeral: Option<bool>,
}Expand description
SSE 流式事件。扁平 struct(方案 §4.1 红线)。data 是裸 JSON 串,由 helper
(parse_sources_event/parse_settlement)二次解析。
v0.11.0 新增 blockIndex/blockType/ephemeral 三字段(in-band content block 元数据)。
Fields§
§event: String§data: String§block_index: Option<i64>对齐 Anthropic content_block_start/delta/stop 的 index 字段。
block_type: Option<String>由 content_block_start 解析得到,delta/stop 从 index→type 映射查出。
ephemeral: Option<bool>网关标记此 block 下一轮不应回传。
Trait Implementations§
Source§impl Clone for StreamEvent
impl Clone for StreamEvent
Source§impl Debug for StreamEvent
impl Debug for StreamEvent
Source§impl Default for StreamEvent
impl Default for StreamEvent
Source§impl<'de> Deserialize<'de> for StreamEvent
impl<'de> Deserialize<'de> for StreamEvent
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
Auto Trait Implementations§
impl Freeze for StreamEvent
impl RefUnwindSafe for StreamEvent
impl Send for StreamEvent
impl Sync for StreamEvent
impl Unpin for StreamEvent
impl UnsafeUnpin for StreamEvent
impl UnwindSafe for StreamEvent
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