pub enum CompletionReference {
ResourceTemplate(ResourceTemplateReference),
Prompt(PromptReference),
}Expand description
Union type for completion references — ref/resource or ref/prompt.
Schema fixes a literal type discriminator per interface
(ResourceTemplateReference.type = "ref/resource",
PromptReference.type = "ref/prompt") — #[serde(untagged)] alone tries
variants in declaration order and can’t reject a type value that
doesn’t match either literal but is otherwise structurally compatible
(e.g. {"type":"bogus","uri":"x"} still matches ResourceTemplateReference
since ref_type is a bare String). Deserialize is hand-written to
dispatch on type before trying a variant, mirroring
PrimitiveSchemaDefinition in elicitation.rs.
Variants§
ResourceTemplate(ResourceTemplateReference)
Prompt(PromptReference)
Implementations§
Source§impl CompletionReference
impl CompletionReference
pub fn resource(uri: impl Into<String>) -> CompletionReference
pub fn prompt(name: impl Into<String>) -> CompletionReference
Trait Implementations§
Source§impl Clone for CompletionReference
impl Clone for CompletionReference
Source§fn clone(&self) -> CompletionReference
fn clone(&self) -> CompletionReference
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for CompletionReference
impl Debug for CompletionReference
Source§impl<'de> Deserialize<'de> for CompletionReference
impl<'de> Deserialize<'de> for CompletionReference
Source§fn deserialize<D>(
deserializer: D,
) -> Result<CompletionReference, <D as Deserializer<'de>>::Error>where
D: Deserializer<'de>,
fn deserialize<D>(
deserializer: D,
) -> Result<CompletionReference, <D as Deserializer<'de>>::Error>where
D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl Serialize for CompletionReference
impl Serialize for CompletionReference
Source§fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
Serialize this value into the given Serde serializer. Read more
Auto Trait Implementations§
impl Freeze for CompletionReference
impl RefUnwindSafe for CompletionReference
impl Send for CompletionReference
impl Sync for CompletionReference
impl Unpin for CompletionReference
impl UnsafeUnpin for CompletionReference
impl UnwindSafe for CompletionReference
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
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<B> IntoFunctionResponse<B, Body> for Bwhere
B: Serialize,
impl<B> IntoFunctionResponse<B, Body> for Bwhere
B: Serialize,
Source§fn into_response(self) -> FunctionResponse<B, Body>
fn into_response(self) -> FunctionResponse<B, Body>
Convert the type into a FunctionResponse.