pub struct StreamResult {
pub status: u16,
pub headers: BTreeMap<String, String>,
pub events: Vec<SseEvent>,
pub ttft_ms: Option<u64>,
pub total_ms: u64,
pub text: String,
pub saw_done_sentinel: bool,
pub content_type: String,
pub bytes: usize,
pub usage: Option<Usage>,
pub error: Option<String>,
}Fields§
§status: u16§headers: BTreeMap<String, String>§events: Vec<SseEvent>§ttft_ms: Option<u64>Time to the first event carrying actual content text — not role
assignments, not message_start, not pings. This is what a user feels
as lag before the answer starts appearing.
total_ms: u64§text: String§saw_done_sentinel: bool§content_type: String§bytes: usizeBytes received, so an empty keep-alive stream is distinguishable from a stream that failed to open at all.
usage: Option<Usage>§error: Option<String>Implementations§
Source§impl StreamResult
impl StreamResult
pub fn event_names(&self) -> Vec<String>
Trait Implementations§
Source§impl Clone for StreamResult
impl Clone for StreamResult
Source§fn clone(&self) -> StreamResult
fn clone(&self) -> StreamResult
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 StreamResult
impl Debug for StreamResult
Source§impl Default for StreamResult
impl Default for StreamResult
Source§fn default() -> StreamResult
fn default() -> StreamResult
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for StreamResult
impl RefUnwindSafe for StreamResult
impl Send for StreamResult
impl Sync for StreamResult
impl Unpin for StreamResult
impl UnsafeUnpin for StreamResult
impl UnwindSafe for StreamResult
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