pub enum StreamAnnotation {
Normal,
NotNull,
Done,
}Expand description
Streaming annotation for field-level emission control.
Controls when a field value should be emitted during streaming parsing.
§Examples
use simple_agents_healing::schema::{StreamAnnotation, Field, Schema};
// Emit as soon as available (default)
let normal_field = Field {
name: "name".to_string(),
schema: Schema::String,
required: true,
aliases: vec![],
default: None,
description: None,
stream_annotation: StreamAnnotation::Normal,
};
// Don't emit until non-null
let id_field = Field {
name: "id".to_string(),
schema: Schema::Int,
required: true,
aliases: vec![],
default: None,
description: None,
stream_annotation: StreamAnnotation::NotNull,
};
// Only emit when complete
let status_field = Field {
name: "status".to_string(),
schema: Schema::String,
required: true,
aliases: vec![],
default: None,
description: None,
stream_annotation: StreamAnnotation::Done,
};Variants§
Normal
Emit field as soon as it’s available (default)
NotNull
Don’t emit until value is non-null (@@stream.not_null)
Done
Only emit when the entire structure is complete (@@stream.done)
Trait Implementations§
Source§impl Clone for StreamAnnotation
impl Clone for StreamAnnotation
Source§fn clone(&self) -> StreamAnnotation
fn clone(&self) -> StreamAnnotation
Returns a duplicate of the value. Read more
1.0.0 · 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 StreamAnnotation
impl Debug for StreamAnnotation
Source§impl Default for StreamAnnotation
impl Default for StreamAnnotation
Source§fn default() -> StreamAnnotation
fn default() -> StreamAnnotation
Returns the “default value” for a type. Read more
Source§impl<'de> Deserialize<'de> for StreamAnnotation
impl<'de> Deserialize<'de> for StreamAnnotation
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
Source§impl PartialEq for StreamAnnotation
impl PartialEq for StreamAnnotation
Source§impl Serialize for StreamAnnotation
impl Serialize for StreamAnnotation
impl Copy for StreamAnnotation
impl Eq for StreamAnnotation
impl StructuralPartialEq for StreamAnnotation
Auto Trait Implementations§
impl Freeze for StreamAnnotation
impl RefUnwindSafe for StreamAnnotation
impl Send for StreamAnnotation
impl Sync for StreamAnnotation
impl Unpin for StreamAnnotation
impl UnsafeUnpin for StreamAnnotation
impl UnwindSafe for StreamAnnotation
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