pub struct ProviderCallId {
pub call_id: String,
pub item_id: Option<String>,
}Expand description
What the provider issued for a call — the only identifiers that may travel back on that provider’s wire.
Dual-identifier wires need both: OpenAI Responses issues an item id
(fc_…) and a call_id (call_…), and expects the right one in each
position. Single-identifier wires carry their id in call_id and leave
item_id empty.
Fields§
§call_id: StringThe call-correlation identifier the provider expects echoed back.
item_id: Option<String>The output-item id issued alongside call_id on dual-identifier
wires (OpenAI Responses fc_…).
Implementations§
Source§impl ProviderCallId
impl ProviderCallId
Sourcepub fn new(call_id: impl Into<String>) -> Option<Self>
pub fn new(call_id: impl Into<String>) -> Option<Self>
Adopt a provider-issued call identifier. None for the empty
string: absence is not an id.
Sourcepub fn with_item_id(self, item_id: impl Into<String>) -> Self
pub fn with_item_id(self, item_id: impl Into<String>) -> Self
Attach the dual-wire output-item id (empty strings are dropped).
Sourcepub fn from_optional_wire(
call_id: Option<String>,
tool_id: Option<String>,
) -> Option<Self>
pub fn from_optional_wire( call_id: Option<String>, tool_id: Option<String>, ) -> Option<Self>
Derive the provider identity from a streaming part’s optional wire
handles. A dual wire carries (call_id, item id); a single wire’s id
arrives as the tool/part id alone and becomes the call_id; with
neither, the identity is absent. The empty-string filtering is
load-bearing: ProviderCallId::new returns None on empty, so an
empty call_id must fall through to the single-id arm rather than
erase a real tool id.
Both streaming surfaces (the parts accumulator and the raw
ToolCall lift) derive through here so they cannot disagree.
ToolCall::from_dual_wire is deliberately different — a dual wire
that omits its call_id has no single-id fallback — and stays
separate.
Trait Implementations§
Source§impl Clone for ProviderCallId
impl Clone for ProviderCallId
Source§fn clone(&self) -> ProviderCallId
fn clone(&self) -> ProviderCallId
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 ProviderCallId
impl Debug for ProviderCallId
Source§impl<'de> Deserialize<'de> for ProviderCallId
impl<'de> Deserialize<'de> for ProviderCallId
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 ProviderCallId
impl PartialEq for ProviderCallId
Source§impl Serialize for ProviderCallId
impl Serialize for ProviderCallId
impl StructuralPartialEq for ProviderCallId
Auto Trait Implementations§
impl Freeze for ProviderCallId
impl RefUnwindSafe for ProviderCallId
impl Send for ProviderCallId
impl Sync for ProviderCallId
impl Unpin for ProviderCallId
impl UnsafeUnpin for ProviderCallId
impl UnwindSafe for ProviderCallId
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> 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