pub struct GatewayExecutors { /* private fields */ }Expand description
Shared, per-server registry of gateway-owned tool executors.
Built once at startup (GatewayExecutors::from_env) and reused across
every request. Configured and request-declared MCP servers are discovered
lazily unless handlers were registered with Self::insert.
Implementations§
Source§impl GatewayExecutors
impl GatewayExecutors
pub fn from_env(client: Arc<Client>) -> Self
Sourcepub fn from_config(
client: Arc<Client>,
config: &ToolRuntimeConfig,
) -> Result<Self, ToolError>
pub fn from_config( client: Arc<Client>, config: &ToolRuntimeConfig, ) -> Result<Self, ToolError>
Builds the shared executors without contacting configured MCP servers.
Configured allowed_tools are applied during discovery, so the stored
handler set is the maximum set that a request may use.
§Errors
Invalid policy configuration is returned as an error. Connection and discovery happen when a configured server is requested.
pub fn insert(&mut self, registration: impl Into<GatewayExecutorRegistration>)
pub fn web_search_handler(&self) -> Option<Arc<dyn GatewayExecutor>>
Sourcepub async fn mcp_handler(
&mut self,
param: &McpToolParam,
) -> Result<Vec<McpDiscoveredHandler>, ToolError>
pub async fn mcp_handler( &mut self, param: &McpToolParam, ) -> Result<Vec<McpDiscoveredHandler>, ToolError>
Returns the discovered handlers for one request-declared MCP server.
§Errors
Returns a configuration error for an invalid declaration or an empty allowed tool set, and an execution error when the server cannot connect.
Trait Implementations§
Source§impl Clone for GatewayExecutors
impl Clone for GatewayExecutors
Source§fn clone(&self) -> GatewayExecutors
fn clone(&self) -> GatewayExecutors
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 GatewayExecutors
impl Debug for GatewayExecutors
Source§impl Default for GatewayExecutors
impl Default for GatewayExecutors
Source§fn default() -> GatewayExecutors
fn default() -> GatewayExecutors
Auto Trait Implementations§
impl !RefUnwindSafe for GatewayExecutors
impl !UnwindSafe for GatewayExecutors
impl Freeze for GatewayExecutors
impl Send for GatewayExecutors
impl Sync for GatewayExecutors
impl Unpin for GatewayExecutors
impl UnsafeUnpin for GatewayExecutors
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,
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