pub struct ParameterSchema {
pub schema_type: SchemaType,
pub description: Option<String>,
pub properties: Option<IndexMap<String, ParameterSchema>>,
pub items: Option<Box<ParameterSchema>>,
pub required: Option<Vec<String>>,
pub enum_values: Option<Vec<String>>,
}Fields§
§schema_type: SchemaType§description: Option<String>§properties: Option<IndexMap<String, ParameterSchema>>§items: Option<Box<ParameterSchema>>§required: Option<Vec<String>>§enum_values: Option<Vec<String>>Implementations§
Source§impl ParameterSchema
impl ParameterSchema
pub fn string(description: impl Into<String>) -> Self
pub fn integer(description: impl Into<String>) -> Self
pub fn number(description: impl Into<String>) -> Self
pub fn boolean(description: impl Into<String>) -> Self
pub fn string_enum( description: impl Into<String>, values: impl IntoIterator<Item = impl Into<String>>, ) -> Self
pub fn array(items: ParameterSchema) -> Self
pub fn object() -> Self
pub fn with_description(self, desc: impl Into<String>) -> Self
pub fn with_property( self, name: impl Into<String>, schema: ParameterSchema, ) -> Self
pub fn with_required( self, fields: impl IntoIterator<Item = impl Into<String>>, ) -> Self
Trait Implementations§
Source§impl Clone for ParameterSchema
impl Clone for ParameterSchema
Source§fn clone(&self) -> ParameterSchema
fn clone(&self) -> ParameterSchema
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 ParameterSchema
impl Debug for ParameterSchema
Source§impl<'de> Deserialize<'de> for ParameterSchema
impl<'de> Deserialize<'de> for ParameterSchema
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations§
impl Freeze for ParameterSchema
impl RefUnwindSafe for ParameterSchema
impl Send for ParameterSchema
impl Sync for ParameterSchema
impl Unpin for ParameterSchema
impl UnsafeUnpin for ParameterSchema
impl UnwindSafe for ParameterSchema
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