pub struct McpServerContributionContext<'a, C> { /* private fields */ }Expand description
Input supplied while resolving MCP server contributions.
Thread-scoped implementations can read stable host inputs through Self::thread_init and
keep their cache in Self::thread_store. Implementations should not retain borrowed context
after contribution completes.
Implementations§
Source§impl<'a, C> McpServerContributionContext<'a, C>
impl<'a, C> McpServerContributionContext<'a, C>
Sourcepub fn global(config: &'a C) -> Self
pub fn global(config: &'a C) -> Self
Creates context for resolution that is not associated with a running thread.
Sourcepub fn for_step(
config: &'a C,
thread_init: &'a ExtensionDataInit,
thread_store: &'a ExtensionData,
originator: &'a str,
ready_selected_capability_roots: &'a [SelectedCapabilityRoot],
executor_capability_discovery: Option<&'a ExecutorCapabilityDiscoverySnapshot>,
) -> Self
pub fn for_step( config: &'a C, thread_init: &'a ExtensionDataInit, thread_store: &'a ExtensionData, originator: &'a str, ready_selected_capability_roots: &'a [SelectedCapabilityRoot], executor_capability_discovery: Option<&'a ExecutorCapabilityDiscoverySnapshot>, ) -> Self
Creates context for one model step using only currently available environments.
Sourcepub fn thread_store(&self) -> Option<&'a ExtensionData>
pub fn thread_store(&self) -> Option<&'a ExtensionData>
Returns extension-owned state when resolving for a running thread.
Sourcepub fn thread_init(&self) -> Option<&'a ExtensionDataInit>
pub fn thread_init(&self) -> Option<&'a ExtensionDataInit>
Returns stable host inputs when resolving for a running thread.
Sourcepub fn originator(&self) -> Option<&'a str>
pub fn originator(&self) -> Option<&'a str>
Returns the effective request originator when resolving for a running thread.
Sourcepub fn ready_selected_capability_roots(
&self,
) -> Option<&'a [SelectedCapabilityRoot]>
pub fn ready_selected_capability_roots( &self, ) -> Option<&'a [SelectedCapabilityRoot]>
Returns selected roots resolved against the ready environments for this model step.
Sourcepub fn executor_capability_discovery(
&self,
) -> Option<&'a ExecutorCapabilityDiscoverySnapshot>
pub fn executor_capability_discovery( &self, ) -> Option<&'a ExecutorCapabilityDiscoverySnapshot>
Returns the executor-materialized capability files for this model step, when enabled.
Trait Implementations§
Source§impl<C> Clone for McpServerContributionContext<'_, C>
impl<C> Clone for McpServerContributionContext<'_, C>
impl<C> Copy for McpServerContributionContext<'_, C>
Auto Trait Implementations§
impl<'a, C> !RefUnwindSafe for McpServerContributionContext<'a, C>
impl<'a, C> !UnwindSafe for McpServerContributionContext<'a, C>
impl<'a, C> Freeze for McpServerContributionContext<'a, C>
impl<'a, C> Send for McpServerContributionContext<'a, C>where
C: Sync,
impl<'a, C> Sync for McpServerContributionContext<'a, C>where
C: Sync,
impl<'a, C> Unpin for McpServerContributionContext<'a, C>
impl<'a, C> UnsafeUnpin for McpServerContributionContext<'a, C>
Blanket Implementations§
Source§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
Source§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
impl<T> AsTypeStaticRegistered for T
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> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
Source§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can
then be further downcast into Box<ConcreteType> where ConcreteType implements Trait.Source§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be
further downcast into Rc<ConcreteType> where ConcreteType implements Trait.Source§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.Source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.Source§impl<T> DowncastSync for T
impl<T> DowncastSync for T
impl<T> ErasedDestructor for Twhere
T: 'static,
Source§impl<T> FutureExt for T
impl<T> FutureExt for T
Source§fn with_context(self, otel_cx: Context) -> WithContext<Self>
fn with_context(self, otel_cx: Context) -> WithContext<Self>
Source§fn with_current_context(self) -> WithContext<Self>
fn with_current_context(self) -> WithContext<Self>
impl<T> HasTyVTable for Twhere
T: ?Sized,
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 moreSource§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
Source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
T in a tonic::Request