#[non_exhaustive]pub struct IntegerField {
pub name: String,
pub label: String,
pub max: Option<i32>,
pub min: Option<i32>,
pub placeholder: String,
pub required: bool,
pub step: Option<i32>,
}Expand description
Defines a field that allows integer numbers to be entered.
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Non-exhaustive structs could have additional fields added in future. Therefore, non-exhaustive structs cannot be constructed in external crates using the traditional
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.name: StringName of the field as it will be included in the encoded query or config object.
label: StringSuggested label to display along the field.
max: Option<i32>Optional maximum value to be entered.
min: Option<i32>Optional minimal value to be entered.
placeholder: StringSuggested placeholder to display when there is no value.
required: boolWhether a value is required.
step: Option<i32>Specifies the granularity that any specified numbers must adhere to.
If omitted, step defaults to “1”, meaning only integers are allowed.
Implementations§
Source§impl IntegerField
impl IntegerField
Sourcepub fn with_bounds(self, min: i32, max: i32) -> Self
pub fn with_bounds(self, min: i32, max: i32) -> Self
Convenience method for setting min and max together.
pub fn with_label(self, label: impl Into<String>) -> Self
pub fn with_max(self, max: i32) -> Self
pub fn with_min(self, min: i32) -> Self
pub fn with_name(self, name: impl Into<String>) -> Self
pub fn with_step(self, step: i32) -> Self
Trait Implementations§
Source§impl Clone for IntegerField
impl Clone for IntegerField
Source§fn clone(&self) -> IntegerField
fn clone(&self) -> IntegerField
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 IntegerField
impl Debug for IntegerField
Source§impl Default for IntegerField
impl Default for IntegerField
Source§fn default() -> IntegerField
fn default() -> IntegerField
Returns the “default value” for a type. Read more
Source§impl<'de> Deserialize<'de> for IntegerField
impl<'de> Deserialize<'de> for IntegerField
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 From<IntegerField> for ConfigField
impl From<IntegerField> for ConfigField
Source§fn from(field: IntegerField) -> Self
fn from(field: IntegerField) -> Self
Converts to this type from the input type.
Source§impl From<IntegerField> for QueryField
impl From<IntegerField> for QueryField
Source§fn from(field: IntegerField) -> Self
fn from(field: IntegerField) -> Self
Converts to this type from the input type.
Source§impl PartialEq for IntegerField
impl PartialEq for IntegerField
Source§impl Serialize for IntegerField
impl Serialize for IntegerField
impl StructuralPartialEq for IntegerField
Auto Trait Implementations§
impl Freeze for IntegerField
impl RefUnwindSafe for IntegerField
impl Send for IntegerField
impl Sync for IntegerField
impl Unpin for IntegerField
impl UnsafeUnpin for IntegerField
impl UnwindSafe for IntegerField
Blanket Implementations§
impl<T> BindgenSerializable for T
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