pub struct ModelEvent { /* private fields */ }Expand description
Provider-neutral semantic event emitted by one model attempt.
sequence starts at zero and is contiguous after provider pings, empty
deltas, and transport framing have been removed. output_index values are
registered contiguously by output_started, while deltas and completion of
already-started outputs may interleave.
Implementations§
Source§impl ModelEvent
impl ModelEvent
Sourcepub const MAX_EVENTS_PER_ATTEMPT: ExecutionCount
pub const MAX_EVENTS_PER_ATTEMPT: ExecutionCount
Maximum number of retained semantic events in one attempt stream.
Sourcepub const MAX_SEQUENCE: ExecutionCount
pub const MAX_SEQUENCE: ExecutionCount
Largest valid zero-based event sequence.
Sourcepub fn new(
attempt_id: AttemptId,
sequence: ExecutionCount,
event: ModelEventKind,
) -> Result<Self, ModelEventError>
pub fn new( attempt_id: AttemptId, sequence: ExecutionCount, event: ModelEventKind, ) -> Result<Self, ModelEventError>
Constructs and intrinsically validates one semantic event.
§Errors
Returns ModelEventError for an out-of-range sequence or output
index, mismatched start provenance, or invalid output-start metadata.
Sourcepub const fn attempt_id(&self) -> AttemptId
pub const fn attempt_id(&self) -> AttemptId
Returns the exact model-attempt identity.
Sourcepub const fn sequence(&self) -> ExecutionCount
pub const fn sequence(&self) -> ExecutionCount
Returns the zero-based contiguous semantic sequence.
Sourcepub const fn event(&self) -> &ModelEventKind
pub const fn event(&self) -> &ModelEventKind
Returns the semantic event body.
Trait Implementations§
Source§impl Clone for ModelEvent
impl Clone for ModelEvent
Source§impl Debug for ModelEvent
impl Debug for ModelEvent
Source§impl<'de> Deserialize<'de> for ModelEvent
impl<'de> Deserialize<'de> for ModelEvent
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 ModelEvent
Source§impl JsonSchema for ModelEvent
impl JsonSchema for ModelEvent
Source§fn schema_id() -> Cow<'static, str>
fn schema_id() -> Cow<'static, str>
Returns a string that uniquely identifies the schema produced by this type. Read more
Source§fn json_schema(generator: &mut SchemaGenerator) -> Schema
fn json_schema(generator: &mut SchemaGenerator) -> Schema
Generates a JSON Schema for this type. Read more
Source§fn inline_schema() -> bool
fn inline_schema() -> bool
Whether JSON Schemas generated for this type should be included directly in parent schemas,
rather than being re-used where possible using the
$ref keyword. Read moreSource§impl PartialEq for ModelEvent
impl PartialEq for ModelEvent
Source§impl Serialize for ModelEvent
impl Serialize for ModelEvent
impl StructuralPartialEq for ModelEvent
Auto Trait Implementations§
impl Forget for ModelEvent
impl Freeze for ModelEvent
impl Move for ModelEvent
impl RefUnwindSafe for ModelEvent
impl Send for ModelEvent
impl Sync for ModelEvent
impl Unpin for ModelEvent
impl UnsafeUnpin for ModelEvent
impl UnwindSafe for ModelEvent
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