pub struct NativeProviderState { /* private fields */ }Expand description
Versioned opaque provider content required to replay one model response.
Implementations§
Source§impl NativeProviderState
impl NativeProviderState
Sourcepub fn new(
exchange_id: impl Into<String>,
provider: impl Into<String>,
api: impl Into<String>,
target: NativeProviderTarget,
model_content: Value,
bindings: Vec<NativeCallBinding>,
) -> Result<NativeProviderState, LLMError>
pub fn new( exchange_id: impl Into<String>, provider: impl Into<String>, api: impl Into<String>, target: NativeProviderTarget, model_content: Value, bindings: Vec<NativeCallBinding>, ) -> Result<NativeProviderState, LLMError>
Creates and validates a provider-neutral replay envelope.
Sourcepub fn from_value(value: Value) -> Result<NativeProviderState, LLMError>
pub fn from_value(value: Value) -> Result<NativeProviderState, LLMError>
Decodes a reserved metadata value and rejects unsupported or oversized state.
Sourcepub fn to_value(&self) -> Result<Value, LLMError>
pub fn to_value(&self) -> Result<Value, LLMError>
Encodes this state for response metadata or the first native call marker.
Sourcepub fn validate(&self) -> Result<(), LLMError>
pub fn validate(&self) -> Result<(), LLMError>
Validates the version, required identities, binding uniqueness, and size bound.
Sourcepub fn validate_for_calls(&self, calls: &[ToolCall]) -> Result<(), LLMError>
pub fn validate_for_calls(&self, calls: &[ToolCall]) -> Result<(), LLMError>
Requires a one-to-one ordered binding for every normalized call.
Sourcepub fn exchange_id(&self) -> &str
pub fn exchange_id(&self) -> &str
Returns the unique model-response occurrence ID.
Sourcepub fn target(&self) -> &NativeProviderTarget
pub fn target(&self) -> &NativeProviderTarget
Returns the credential-free replay target.
Sourcepub fn model_content(&self) -> &Value
pub fn model_content(&self) -> &Value
Returns the opaque original model content without transforming it.
Sourcepub fn bindings(&self) -> &[NativeCallBinding]
pub fn bindings(&self) -> &[NativeCallBinding]
Returns the ordered runtime-call-to-part bindings.
Sourcepub fn serialized_len(&self) -> Result<usize, LLMError>
pub fn serialized_len(&self) -> Result<usize, LLMError>
Returns the serialized byte length used by diagnostics and limits.
Trait Implementations§
Source§impl Clone for NativeProviderState
impl Clone for NativeProviderState
Source§fn clone(&self) -> NativeProviderState
fn clone(&self) -> NativeProviderState
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 NativeProviderState
impl Debug for NativeProviderState
Source§impl<'de> Deserialize<'de> for NativeProviderState
impl<'de> Deserialize<'de> for NativeProviderState
Source§fn deserialize<__D>(
__deserializer: __D,
) -> Result<NativeProviderState, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D,
) -> Result<NativeProviderState, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl PartialEq for NativeProviderState
impl PartialEq for NativeProviderState
Source§impl Serialize for NativeProviderState
impl Serialize for NativeProviderState
Source§fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
Serialize this value into the given Serde serializer. Read more
impl StructuralPartialEq for NativeProviderState
Auto Trait Implementations§
impl Freeze for NativeProviderState
impl RefUnwindSafe for NativeProviderState
impl Send for NativeProviderState
impl Sync for NativeProviderState
impl Unpin for NativeProviderState
impl UnsafeUnpin for NativeProviderState
impl UnwindSafe for NativeProviderState
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more