Skip to main content

ToolBinding

Enum ToolBinding 

Source
pub enum ToolBinding {
    Client {
        resolver: Arc<dyn ToolResourceResolver>,
        executor: Arc<dyn ToolExecutor>,
    },
    Hosted {
        options: HostedToolOptions,
    },
    Hybrid {
        options: HostedToolOptions,
        resolver: Arc<dyn ToolResourceResolver>,
        executor: Arc<dyn ToolExecutor>,
        preference: ToolRoutePreference,
    },
}
Expand description

Complete executable binding associated with one portable ToolSpec.

Variants§

§

Client

A function tool resolved and executed by the client runtime.

Fields

§resolver: Arc<dyn ToolResourceResolver>

Resource resolver used before policy evaluation.

§executor: Arc<dyn ToolExecutor>

Local executor invoked after policy approval.

§

Hosted

A tool executed entirely inside a capable model provider.

Fields

§options: HostedToolOptions

Provider-neutral hosted tool kind and common policy.

§

Hybrid

A tool with both provider-hosted and real client execution routes.

Fields

§options: HostedToolOptions

Provider-neutral hosted tool kind and common policy.

§resolver: Arc<dyn ToolResourceResolver>

Resource resolver for the client fallback.

§executor: Arc<dyn ToolExecutor>

Executor for the client fallback.

§preference: ToolRoutePreference

Route preference applied when freezing a model request.

Implementations§

Source§

impl ToolBinding

Source

pub fn client( resolver: Arc<dyn ToolResourceResolver>, executor: Arc<dyn ToolExecutor>, ) -> Self

Creates a client-only binding.

Source

pub const fn hosted(options: HostedToolOptions) -> Self

Creates a provider-hosted-only binding.

Source

pub fn hybrid( options: HostedToolOptions, preference: ToolRoutePreference, resolver: Arc<dyn ToolResourceResolver>, executor: Arc<dyn ToolExecutor>, ) -> Self

Creates a binding with hosted and client routes.

Source

pub const fn has_client_execution(&self) -> bool

Returns whether this binding has a real client execution route.

Trait Implementations§

Source§

impl Clone for ToolBinding

Source§

fn clone(&self) -> ToolBinding

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for ToolBinding

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.