pub struct SdkCodeExecutor<S> { /* private fields */ }Expand description
Adapter bridging [SdkExecutor] to CodeExecutor for SDK-backed servers
(Pattern C: JS+SDK).
Uses a no-op HTTP executor stub since SDK plans route through
PlanExecutor::set_sdk_executor instead of HTTP calls.
§Example
ⓘ
use pmcp_code_mode::{SdkCodeExecutor, ExecutionConfig};
let sdk = MyCostExplorerSdk::new(credentials);
let config = ExecutionConfig::default();
let executor = Arc::new(SdkCodeExecutor::new(sdk, config));Implementations§
Source§impl<S: SdkExecutor + Clone + 'static> SdkCodeExecutor<S>
impl<S: SdkExecutor + Clone + 'static> SdkCodeExecutor<S>
Sourcepub fn new(sdk: S, config: ExecutionConfig) -> Self
pub fn new(sdk: S, config: ExecutionConfig) -> Self
Create a new SDK code executor with the given SDK backend and config.
Trait Implementations§
Source§impl<S: SdkExecutor + Clone + 'static> CodeExecutor for SdkCodeExecutor<S>
impl<S: SdkExecutor + Clone + 'static> CodeExecutor for SdkCodeExecutor<S>
Source§fn execute<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
code: &'life1 str,
variables: Option<&'life2 Value>,
) -> Pin<Box<dyn Future<Output = Result<Value, ExecutionError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
fn execute<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
code: &'life1 str,
variables: Option<&'life2 Value>,
) -> Pin<Box<dyn Future<Output = Result<Value, ExecutionError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Execute validated code and return the result. Read more
Auto Trait Implementations§
impl<S> Freeze for SdkCodeExecutor<S>where
S: Freeze,
impl<S> RefUnwindSafe for SdkCodeExecutor<S>where
S: RefUnwindSafe,
impl<S> Send for SdkCodeExecutor<S>where
S: Send,
impl<S> Sync for SdkCodeExecutor<S>where
S: Sync,
impl<S> Unpin for SdkCodeExecutor<S>where
S: Unpin,
impl<S> UnsafeUnpin for SdkCodeExecutor<S>where
S: UnsafeUnpin,
impl<S> UnwindSafe for SdkCodeExecutor<S>where
S: UnwindSafe,
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> 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 moreCreates a shared type from an unshared type.