pub struct ProviderStreamChunk {
pub schema_version: u16,
pub chunk_index: u32,
pub delta: ProviderStreamDelta,
pub is_terminal: bool,
pub usage: Option<ProviderUsage>,
}Expand description
Carries provider stream chunk data across a host-port boundary. Constructing the value does not call the host; the port method that receives it documents any adapter, network, or storage effect.
Fields§
§schema_version: u16Wire schema version used for compatibility checks.
chunk_index: u32Chunk index used by this record or request.
delta: ProviderStreamDeltaDelta used by this record or request.
is_terminal: boolWhether is terminal is enabled. Policy, validation, or routing code uses this flag to choose the explicit behavior.
usage: Option<ProviderUsage>Optional usage value. When absent, callers should use the documented default or skip that optional behavior.
Implementations§
Source§impl ProviderStreamChunk
impl ProviderStreamChunk
Sourcepub const SCHEMA_VERSION: u16 = 1
pub const SCHEMA_VERSION: u16 = 1
Constant value for the ports::provider contract. Use it to keep SDK records and tests aligned on the same stable value.
Sourcepub fn text(chunk_index: u32, text: impl Into<String>) -> Self
pub fn text(chunk_index: u32, text: impl Into<String>) -> Self
Builds the text value. This is data construction and performs no I/O, journal append, event publication, or process work.
Sourcepub fn final_text(
text: impl Into<String>,
stop_reason: ProviderStopReason,
usage: Option<ProviderUsage>,
) -> Self
pub fn final_text( text: impl Into<String>, stop_reason: ProviderStopReason, usage: Option<ProviderUsage>, ) -> Self
Builds the final text value. This is data construction and performs no I/O, journal append, event publication, or process work.
Trait Implementations§
Source§impl Clone for ProviderStreamChunk
impl Clone for ProviderStreamChunk
Source§fn clone(&self) -> ProviderStreamChunk
fn clone(&self) -> ProviderStreamChunk
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for ProviderStreamChunk
impl Debug for ProviderStreamChunk
Source§impl<'de> Deserialize<'de> for ProviderStreamChunk
impl<'de> Deserialize<'de> for ProviderStreamChunk
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>,
Source§impl PartialEq for ProviderStreamChunk
impl PartialEq for ProviderStreamChunk
Source§fn eq(&self, other: &ProviderStreamChunk) -> bool
fn eq(&self, other: &ProviderStreamChunk) -> bool
self and other values to be equal, and is used by ==.