#[non_exhaustive]pub enum PrimitiveSchemaDefinition {
Enum(EnumSchema),
String(StringSchema),
Number(NumberSchema),
Integer(IntegerSchema),
Boolean(BooleanSchema),
}Expand description
Primitive schema definition for elicitation properties.
According to MCP 2025-06-18 specification, elicitation schemas must have properties of primitive types only (string, number, integer, boolean, enum).
Note: Put Enum as the first variant to avoid ambiguity during deserialization. This is due to the fact that EnumSchema can contain StringSchema internally and serde uses first match wins strategy when deserializing untagged enums.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.
Enum(EnumSchema)
Enum property (explicit enum schema)
String(StringSchema)
String property (with optional enum constraint)
Number(NumberSchema)
Number property (with optional enum constraint)
Integer(IntegerSchema)
Integer property (with optional enum constraint)
Boolean(BooleanSchema)
Boolean property
Trait Implementations§
Source§impl Clone for PrimitiveSchemaDefinition
impl Clone for PrimitiveSchemaDefinition
Source§fn clone(&self) -> PrimitiveSchemaDefinition
fn clone(&self) -> PrimitiveSchemaDefinition
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 PrimitiveSchemaDefinition
impl Debug for PrimitiveSchemaDefinition
Source§impl<'de> Deserialize<'de> for PrimitiveSchemaDefinition
impl<'de> Deserialize<'de> for PrimitiveSchemaDefinition
Source§fn deserialize<__D>(
__deserializer: __D,
) -> Result<PrimitiveSchemaDefinition, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D,
) -> Result<PrimitiveSchemaDefinition, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl JsonSchema for PrimitiveSchemaDefinition
impl JsonSchema for PrimitiveSchemaDefinition
Source§fn schema_id() -> Cow<'static, str>
fn schema_id() -> Cow<'static, str>
Returns a string that uniquely identifies the schema produced by this type. Read more
Source§fn json_schema(generator: &mut SchemaGenerator) -> Schema
fn json_schema(generator: &mut SchemaGenerator) -> Schema
Generates a JSON Schema for this type. Read more
Source§fn inline_schema() -> bool
fn inline_schema() -> bool
Whether JSON Schemas generated for this type should be included directly in parent schemas,
rather than being re-used where possible using the
$ref keyword. Read moreSource§impl Serialize for PrimitiveSchemaDefinition
impl Serialize for PrimitiveSchemaDefinition
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
impl StructuralPartialEq for PrimitiveSchemaDefinition
Auto Trait Implementations§
impl Freeze for PrimitiveSchemaDefinition
impl RefUnwindSafe for PrimitiveSchemaDefinition
impl Send for PrimitiveSchemaDefinition
impl Sync for PrimitiveSchemaDefinition
impl Unpin for PrimitiveSchemaDefinition
impl UnsafeUnpin for PrimitiveSchemaDefinition
impl UnwindSafe for PrimitiveSchemaDefinition
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