pub struct NumberSchema {
pub type_: NumberTypeConst,
pub title: Option<Cow<'static, str>>,
pub description: Option<Cow<'static, str>>,
pub minimum: Option<f64>,
pub maximum: Option<f64>,
}Expand description
Schema definition for number properties (floating-point).
Fields§
§type_: NumberTypeConst§title: Option<Cow<'static, str>>§description: Option<Cow<'static, str>>§minimum: Option<f64>§maximum: Option<f64>Implementations§
Source§impl NumberSchema
impl NumberSchema
pub fn new() -> Self
pub fn with_range(self, min: f64, max: f64) -> Result<Self, &'static str>
pub fn range(self, min: f64, max: f64) -> Self
pub fn minimum(self, min: f64) -> Self
pub fn maximum(self, max: f64) -> Self
pub fn title(self, title: impl Into<Cow<'static, str>>) -> Self
pub fn description(self, description: impl Into<Cow<'static, str>>) -> Self
Trait Implementations§
Source§impl Clone for NumberSchema
impl Clone for NumberSchema
Source§fn clone(&self) -> NumberSchema
fn clone(&self) -> NumberSchema
Returns a duplicate 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 NumberSchema
impl Debug for NumberSchema
Source§impl Default for NumberSchema
impl Default for NumberSchema
Source§impl<'de> Deserialize<'de> for NumberSchema
impl<'de> Deserialize<'de> for NumberSchema
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
Source§impl PartialEq for NumberSchema
impl PartialEq for NumberSchema
Source§impl Serialize for NumberSchema
impl Serialize for NumberSchema
impl StructuralPartialEq for NumberSchema
Auto Trait Implementations§
impl Freeze for NumberSchema
impl RefUnwindSafe for NumberSchema
impl Send for NumberSchema
impl Sync for NumberSchema
impl Unpin for NumberSchema
impl UnwindSafe for NumberSchema
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