pub struct PartStart {
pub index: usize,
pub part: Option<MessagePart>,
}Expand description
The start of a new part within the response.
Emitted once per part, before any IndexedDelta
events. The part field may be None for text parts
(where the type is inferred from deltas) or Some for tool-call
parts where the id and name are known upfront.
§Example
use loopctl::stream::PartStart;
use loopctl::message::MessagePart;
use serde_json::Value;
// Text part start — type is implicit
let text_start = PartStart { index: 0, part: None };
// Tool-call part start — id and name are provided
let tool_start = PartStart {
index: 1,
part: Some(MessagePart::tool_call("tool_1", "read_file", Value::Null)),
};Fields§
§index: usizeZero-based index of this part within the message.
Sequentially assigned by the API. Used to correlate
IndexedDelta events with the correct part.
Indices are monotonically increasing within a single stream.
part: Option<MessagePart>The part, if known at start time.
Some for tool-call parts (so the id and name are
available immediately). None for text parts, where
the type is inferred from subsequent DeltaPart::Text
deltas. The StreamAccumulator uses this to seed the
tool ID and name before deltas arrive.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for PartStart
impl<'de> Deserialize<'de> for PartStart
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 PartStart
impl RefUnwindSafe for PartStart
impl Send for PartStart
impl Sync for PartStart
impl Unpin for PartStart
impl UnsafeUnpin for PartStart
impl UnwindSafe for PartStart
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