pub struct ModelStreamState {
pub lifecycle: StreamLifecycle,
pub started_parts: usize,
pub ended_parts: usize,
pub final_response: Option<Box<ModelResponse>>,
}Expand description
Lightweight stream assembly state for replay and lifecycle assertions.
Fields§
§lifecycle: StreamLifecycleCurrent lifecycle.
started_parts: usizeNumber of started parts.
ended_parts: usizeNumber of ended parts.
final_response: Option<Box<ModelResponse>>Final response when available.
Implementations§
Source§impl ModelStreamState
impl ModelStreamState
Sourcepub fn apply(&mut self, event: &ModelResponseStreamEvent)
pub fn apply(&mut self, event: &ModelResponseStreamEvent)
Apply one stream event.
Trait Implementations§
Source§impl Clone for ModelStreamState
impl Clone for ModelStreamState
Source§fn clone(&self) -> ModelStreamState
fn clone(&self) -> ModelStreamState
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 ModelStreamState
impl Debug for ModelStreamState
Source§impl Default for ModelStreamState
impl Default for ModelStreamState
Source§fn default() -> ModelStreamState
fn default() -> ModelStreamState
Returns the “default value” for a type. Read more
Source§impl<'de> Deserialize<'de> for ModelStreamState
impl<'de> Deserialize<'de> for ModelStreamState
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
impl Eq for ModelStreamState
Source§impl PartialEq for ModelStreamState
impl PartialEq for ModelStreamState
Source§impl Serialize for ModelStreamState
impl Serialize for ModelStreamState
impl StructuralPartialEq for ModelStreamState
Auto Trait Implementations§
impl Freeze for ModelStreamState
impl RefUnwindSafe for ModelStreamState
impl Send for ModelStreamState
impl Sync for ModelStreamState
impl Unpin for ModelStreamState
impl UnsafeUnpin for ModelStreamState
impl UnwindSafe for ModelStreamState
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