pub struct Native {
pub item: Value,
pub fingerprint: Fingerprint,
pub baseline: Option<Value>,
pub edited: bool,
pub blob_slot: Option<Cow<'static, str>>,
}Expand description
One provider item, verbatim in its API’s JSON shape, beside the canonical block (or message) it was decoded to.
baseline compares calls after storage; other blocks and older records
use fingerprint. An edited block keeps its item for identity, but
encoders rebuild it from canonical fields.
Fields§
§item: ValueThe provider item.
fingerprint: FingerprintThe fingerprint of the canonical form the item was decoded to.
baseline: Option<Value>The original projection of a call containing floats. Floats stay
numeric; integers and strings carry text markers to preserve their type
and exact value. Other blocks and older records use fingerprint-only
validation. Construct this with super::AssistantContent::with_native.
Keep it unchanged when editing the call.
edited: boolWhether an edit was detected before serialization. A stored edit stays stale even if JSON parsing makes its numbers equal again.
blob_slot: Option<Cow<'static, str>>Where the item keeps its reasoning blob, as a JSON pointer such as
/signature, when it holds one. The reply fold sets it from the
wire’s ReplayTarget::blob_slots.
Implementations§
Source§impl Native
impl Native
Sourcepub fn reasoning_blob(&self) -> Option<Blob<'_>>
pub fn reasoning_blob(&self) -> Option<Blob<'_>>
The opaque part of this item, when it holds one: a reasoning signature or encrypted reasoning, which only the provider that made it can read and which it may refuse once anything around it changed.
use rig_core::message::{Fingerprint, Native};
let native = Native {
item: serde_json::json!({"type": "thinking", "thinking": "plan", "signature": "c2ln"}),
fingerprint: Fingerprint::of(&"plan"),
baseline: None,
edited: false,
blob_slot: Some("/signature".into()),
};
assert_eq!(native.reasoning_blob().map(|blob| blob.value), Some("c2ln"));Trait Implementations§
Source§impl<'de> Deserialize<'de> for Native
impl<'de> Deserialize<'de> for Native
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>,
impl StructuralPartialEq for Native
Auto Trait Implementations§
impl Freeze for Native
impl RefUnwindSafe for Native
impl Send for Native
impl Sync for Native
impl Unpin for Native
impl UnsafeUnpin for Native
impl UnwindSafe for Native
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
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> ⓘ
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> ⓘ
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