pub struct JsonPropertySchema { /* private fields */ }Expand description
A schema for a property of an object
Implementations§
Source§impl JsonPropertySchema
impl JsonPropertySchema
Sourcepub fn new(name: impl ToString, ty: SchemaType) -> Self
pub fn new(name: impl ToString, ty: SchemaType) -> Self
Create a new property schema
Sourcepub fn with_description(
self,
description: impl Into<Option<&'static str>>,
) -> Self
pub fn with_description( self, description: impl Into<Option<&'static str>>, ) -> Self
Set the description of the property
Sourcepub fn with_required(self, required: bool) -> Self
pub fn with_required(self, required: bool) -> Self
Set whether the property is required
Trait Implementations§
Source§impl Clone for JsonPropertySchema
impl Clone for JsonPropertySchema
Source§fn clone(&self) -> JsonPropertySchema
fn clone(&self) -> JsonPropertySchema
Returns a copy of the value. Read more
1.0.0 · 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 JsonPropertySchema
impl Debug for JsonPropertySchema
Auto Trait Implementations§
impl Freeze for JsonPropertySchema
impl RefUnwindSafe for JsonPropertySchema
impl Send for JsonPropertySchema
impl Sync for JsonPropertySchema
impl Unpin for JsonPropertySchema
impl UnwindSafe for JsonPropertySchema
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