pub struct IntValidatorBuilder<Num, S = Empty>where
S: State,
Num: IntWrapper,{ /* private fields */ }Expand description
Builder for IntValidator.
Implementations§
Source§impl<Num, S> IntValidatorBuilder<Num, S>where
S: State,
Num: IntWrapper,
impl<Num, S> IntValidatorBuilder<Num, S>where
S: State,
Num: IntWrapper,
Sourcepub fn with_error_messages(
self,
error_messages: impl IntoIterator<Item = (Num::ViolationEnum, impl Into<FixedStr>)>,
) -> IntValidatorBuilder<Num, SetErrorMessages<S>>where
S::ErrorMessages: IsUnset,
pub fn with_error_messages(
self,
error_messages: impl IntoIterator<Item = (Num::ViolationEnum, impl Into<FixedStr>)>,
) -> IntValidatorBuilder<Num, SetErrorMessages<S>>where
S::ErrorMessages: IsUnset,
Adds a map with custom error messages to the underlying validator.
If a violation has no custom error message attached to it, it uses the default error message.
Sourcepub fn ignore_always(self) -> IntValidatorBuilder<Num, SetIgnore<S>>where
S::Ignore: IsUnset,
pub fn ignore_always(self) -> IntValidatorBuilder<Num, SetIgnore<S>>where
S::Ignore: IsUnset,
Specifies that this validator should always be ignored.
Sourcepub fn ignore_if_zero_value(self) -> IntValidatorBuilder<Num, SetIgnore<S>>where
S::Ignore: IsUnset,
pub fn ignore_if_zero_value(self) -> IntValidatorBuilder<Num, SetIgnore<S>>where
S::Ignore: IsUnset,
Specifies that this validator should be ignored if the value is either unset or equal to its protobuf zero value.
Sourcepub fn cel(self, program: CelProgram) -> IntValidatorBuilder<Num, S>
pub fn cel(self, program: CelProgram) -> IntValidatorBuilder<Num, S>
Adds a CelProgram to this validator.
Sourcepub fn required(self) -> IntValidatorBuilder<Num, SetRequired<S>>where
S::Required: IsUnset,
pub fn required(self) -> IntValidatorBuilder<Num, SetRequired<S>>where
S::Required: IsUnset,
Specifies that the field must be set (if optional) or not equal to its zero value (if not optional) in order to be valid.
Sourcepub fn const_(self, val: Num::RustType) -> IntValidatorBuilder<Num, SetConst<S>>where
S::Const: IsUnset,
pub fn const_(self, val: Num::RustType) -> IntValidatorBuilder<Num, SetConst<S>>where
S::Const: IsUnset,
Specifies that only this specific value will be considered valid for this field.
Sourcepub fn lt(self, val: Num::RustType) -> IntValidatorBuilder<Num, SetLt<S>>where
S::Lt: IsUnset,
pub fn lt(self, val: Num::RustType) -> IntValidatorBuilder<Num, SetLt<S>>where
S::Lt: IsUnset,
Specifies that this field’s value will be valid only if it is smaller than the specified amount
Sourcepub fn lte(self, val: Num::RustType) -> IntValidatorBuilder<Num, SetLte<S>>where
S::Lte: IsUnset,
pub fn lte(self, val: Num::RustType) -> IntValidatorBuilder<Num, SetLte<S>>where
S::Lte: IsUnset,
Specifies that this field’s value will be valid only if it is smaller than, or equal to, the specified amount
Sourcepub fn gt(self, val: Num::RustType) -> IntValidatorBuilder<Num, SetGt<S>>where
S::Gt: IsUnset,
pub fn gt(self, val: Num::RustType) -> IntValidatorBuilder<Num, SetGt<S>>where
S::Gt: IsUnset,
Specifies that this field’s value will be valid only if it is greater than the specified amount
Sourcepub fn gte(self, val: Num::RustType) -> IntValidatorBuilder<Num, SetGte<S>>where
S::Gte: IsUnset,
pub fn gte(self, val: Num::RustType) -> IntValidatorBuilder<Num, SetGte<S>>where
S::Gte: IsUnset,
Specifies that this field’s value will be valid only if it is smaller than, or equal to, the specified amount
Sourcepub fn not_in(
self,
list: impl IntoSortedList<Num::RustType>,
) -> IntValidatorBuilder<Num, SetNotIn<S>>where
S::NotIn: IsUnset,
pub fn not_in(
self,
list: impl IntoSortedList<Num::RustType>,
) -> IntValidatorBuilder<Num, SetNotIn<S>>where
S::NotIn: IsUnset,
Specifies that the values in this list will be considered NOT valid for this field.
Sourcepub fn in_(
self,
list: impl IntoSortedList<Num::RustType>,
) -> IntValidatorBuilder<Num, SetIn<S>>where
S::In: IsUnset,
pub fn in_(
self,
list: impl IntoSortedList<Num::RustType>,
) -> IntValidatorBuilder<Num, SetIn<S>>where
S::In: IsUnset,
Specifies that only the values in this list will be considered valid for this field.
Sourcepub fn build(self) -> IntValidator<Num>
pub fn build(self) -> IntValidator<Num>
Builds the validator.
Trait Implementations§
Source§impl<Num, S> Clone for IntValidatorBuilder<Num, S>
impl<Num, S> Clone for IntValidatorBuilder<Num, S>
Source§fn clone(&self) -> IntValidatorBuilder<Num, S>
fn clone(&self) -> IntValidatorBuilder<Num, S>
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl<Num, S> Debug for IntValidatorBuilder<Num, S>
impl<Num, S> Debug for IntValidatorBuilder<Num, S>
Source§impl<Num, S> Default for IntValidatorBuilder<Num, S>where
S: State,
Num: IntWrapper,
impl<Num, S> Default for IntValidatorBuilder<Num, S>where
S: State,
Num: IntWrapper,
Source§impl<S, N> From<IntValidatorBuilder<N, S>> for ProtoOptionwhere
S: State,
N: IntWrapper,
impl<S, N> From<IntValidatorBuilder<N, S>> for ProtoOptionwhere
S: State,
N: IntWrapper,
Source§fn from(value: IntValidatorBuilder<N, S>) -> Self
fn from(value: IntValidatorBuilder<N, S>) -> Self
Source§impl<Num, S> Hash for IntValidatorBuilder<Num, S>
impl<Num, S> Hash for IntValidatorBuilder<Num, S>
Source§impl<Num, S> PartialEq for IntValidatorBuilder<Num, S>
impl<Num, S> PartialEq for IntValidatorBuilder<Num, S>
Source§impl<S: State, Num: IntWrapper> ValidatorBuilderFor<Num> for IntValidatorBuilder<Num, S>
impl<S: State, Num: IntWrapper> ValidatorBuilderFor<Num> for IntValidatorBuilder<Num, S>
type Validator = IntValidator<Num>
Source§fn build_validator(self) -> Self::Validator
fn build_validator(self) -> Self::Validator
Validator.impl<Num, S> Eq for IntValidatorBuilder<Num, S>
impl<Num, S> StructuralPartialEq for IntValidatorBuilder<Num, S>where
S: State,
Num: IntWrapper,
Auto Trait Implementations§
impl<Num, S> Freeze for IntValidatorBuilder<Num, S>
impl<Num, S> RefUnwindSafe for IntValidatorBuilder<Num, S>where
S: RefUnwindSafe,
Num: RefUnwindSafe,
<Num as IntWrapper>::RustType: RefUnwindSafe,
<Num as IntWrapper>::ViolationEnum: RefUnwindSafe,
impl<Num, S> Send for IntValidatorBuilder<Num, S>where
S: Send,
impl<Num, S> Sync for IntValidatorBuilder<Num, S>where
S: Sync,
impl<Num, S> Unpin for IntValidatorBuilder<Num, S>
impl<Num, S> UnwindSafe for IntValidatorBuilder<Num, S>where
S: UnwindSafe,
Num: UnwindSafe,
<Num as IntWrapper>::RustType: UnwindSafe + RefUnwindSafe,
<Num as IntWrapper>::ViolationEnum: RefUnwindSafe,
Blanket Implementations§
Source§impl<T> AnyExt for T
impl<T> AnyExt for T
Source§fn downcast_ref<T>(this: &Self) -> Option<&T>where
T: Any,
fn downcast_ref<T>(this: &Self) -> Option<&T>where
T: Any,
T behind referenceSource§fn downcast_mut<T>(this: &mut Self) -> Option<&mut T>where
T: Any,
fn downcast_mut<T>(this: &mut Self) -> Option<&mut T>where
T: Any,
T behind mutable referenceSource§fn downcast_rc<T>(this: Rc<Self>) -> Result<Rc<T>, Rc<Self>>where
T: Any,
fn downcast_rc<T>(this: Rc<Self>) -> Result<Rc<T>, Rc<Self>>where
T: Any,
T behind Rc pointerSource§fn downcast_arc<T>(this: Arc<Self>) -> Result<Arc<T>, Arc<Self>>where
T: Any,
fn downcast_arc<T>(this: Arc<Self>) -> Result<Arc<T>, Arc<Self>>where
T: Any,
T behind Arc pointerSource§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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T, X> CoerceTo<T> for Xwhere
T: CoerceFrom<X> + ?Sized,
impl<T, X> CoerceTo<T> for Xwhere
T: CoerceFrom<X> + ?Sized,
fn coerce_rc_to(self: Rc<X>) -> Rc<T>
fn coerce_box_to(self: Box<X>) -> Box<T>
fn coerce_ref_to(&self) -> &T
fn coerce_mut_to(&mut self) -> &mut T
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
Source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
T in a tonic::RequestSource§impl<D> OwoColorize for D
impl<D> OwoColorize for D
Source§fn fg<C>(&self) -> FgColorDisplay<'_, C, Self>where
C: Color,
fn fg<C>(&self) -> FgColorDisplay<'_, C, Self>where
C: Color,
Source§fn bg<C>(&self) -> BgColorDisplay<'_, C, Self>where
C: Color,
fn bg<C>(&self) -> BgColorDisplay<'_, C, Self>where
C: Color,
Source§fn black(&self) -> FgColorDisplay<'_, Black, Self>
fn black(&self) -> FgColorDisplay<'_, Black, Self>
Source§fn on_black(&self) -> BgColorDisplay<'_, Black, Self>
fn on_black(&self) -> BgColorDisplay<'_, Black, Self>
Source§fn red(&self) -> FgColorDisplay<'_, Red, Self>
fn red(&self) -> FgColorDisplay<'_, Red, Self>
Source§fn on_red(&self) -> BgColorDisplay<'_, Red, Self>
fn on_red(&self) -> BgColorDisplay<'_, Red, Self>
Source§fn green(&self) -> FgColorDisplay<'_, Green, Self>
fn green(&self) -> FgColorDisplay<'_, Green, Self>
Source§fn on_green(&self) -> BgColorDisplay<'_, Green, Self>
fn on_green(&self) -> BgColorDisplay<'_, Green, Self>
Source§fn yellow(&self) -> FgColorDisplay<'_, Yellow, Self>
fn yellow(&self) -> FgColorDisplay<'_, Yellow, Self>
Source§fn on_yellow(&self) -> BgColorDisplay<'_, Yellow, Self>
fn on_yellow(&self) -> BgColorDisplay<'_, Yellow, Self>
Source§fn blue(&self) -> FgColorDisplay<'_, Blue, Self>
fn blue(&self) -> FgColorDisplay<'_, Blue, Self>
Source§fn on_blue(&self) -> BgColorDisplay<'_, Blue, Self>
fn on_blue(&self) -> BgColorDisplay<'_, Blue, Self>
Source§fn magenta(&self) -> FgColorDisplay<'_, Magenta, Self>
fn magenta(&self) -> FgColorDisplay<'_, Magenta, Self>
Source§fn on_magenta(&self) -> BgColorDisplay<'_, Magenta, Self>
fn on_magenta(&self) -> BgColorDisplay<'_, Magenta, Self>
Source§fn purple(&self) -> FgColorDisplay<'_, Magenta, Self>
fn purple(&self) -> FgColorDisplay<'_, Magenta, Self>
Source§fn on_purple(&self) -> BgColorDisplay<'_, Magenta, Self>
fn on_purple(&self) -> BgColorDisplay<'_, Magenta, Self>
Source§fn cyan(&self) -> FgColorDisplay<'_, Cyan, Self>
fn cyan(&self) -> FgColorDisplay<'_, Cyan, Self>
Source§fn on_cyan(&self) -> BgColorDisplay<'_, Cyan, Self>
fn on_cyan(&self) -> BgColorDisplay<'_, Cyan, Self>
Source§fn white(&self) -> FgColorDisplay<'_, White, Self>
fn white(&self) -> FgColorDisplay<'_, White, Self>
Source§fn on_white(&self) -> BgColorDisplay<'_, White, Self>
fn on_white(&self) -> BgColorDisplay<'_, White, Self>
Source§fn default_color(&self) -> FgColorDisplay<'_, Default, Self>
fn default_color(&self) -> FgColorDisplay<'_, Default, Self>
Source§fn on_default_color(&self) -> BgColorDisplay<'_, Default, Self>
fn on_default_color(&self) -> BgColorDisplay<'_, Default, Self>
Source§fn bright_black(&self) -> FgColorDisplay<'_, BrightBlack, Self>
fn bright_black(&self) -> FgColorDisplay<'_, BrightBlack, Self>
Source§fn on_bright_black(&self) -> BgColorDisplay<'_, BrightBlack, Self>
fn on_bright_black(&self) -> BgColorDisplay<'_, BrightBlack, Self>
Source§fn bright_red(&self) -> FgColorDisplay<'_, BrightRed, Self>
fn bright_red(&self) -> FgColorDisplay<'_, BrightRed, Self>
Source§fn on_bright_red(&self) -> BgColorDisplay<'_, BrightRed, Self>
fn on_bright_red(&self) -> BgColorDisplay<'_, BrightRed, Self>
Source§fn bright_green(&self) -> FgColorDisplay<'_, BrightGreen, Self>
fn bright_green(&self) -> FgColorDisplay<'_, BrightGreen, Self>
Source§fn on_bright_green(&self) -> BgColorDisplay<'_, BrightGreen, Self>
fn on_bright_green(&self) -> BgColorDisplay<'_, BrightGreen, Self>
Source§fn bright_yellow(&self) -> FgColorDisplay<'_, BrightYellow, Self>
fn bright_yellow(&self) -> FgColorDisplay<'_, BrightYellow, Self>
Source§fn on_bright_yellow(&self) -> BgColorDisplay<'_, BrightYellow, Self>
fn on_bright_yellow(&self) -> BgColorDisplay<'_, BrightYellow, Self>
Source§fn bright_blue(&self) -> FgColorDisplay<'_, BrightBlue, Self>
fn bright_blue(&self) -> FgColorDisplay<'_, BrightBlue, Self>
Source§fn on_bright_blue(&self) -> BgColorDisplay<'_, BrightBlue, Self>
fn on_bright_blue(&self) -> BgColorDisplay<'_, BrightBlue, Self>
Source§fn bright_magenta(&self) -> FgColorDisplay<'_, BrightMagenta, Self>
fn bright_magenta(&self) -> FgColorDisplay<'_, BrightMagenta, Self>
Source§fn on_bright_magenta(&self) -> BgColorDisplay<'_, BrightMagenta, Self>
fn on_bright_magenta(&self) -> BgColorDisplay<'_, BrightMagenta, Self>
Source§fn bright_purple(&self) -> FgColorDisplay<'_, BrightMagenta, Self>
fn bright_purple(&self) -> FgColorDisplay<'_, BrightMagenta, Self>
Source§fn on_bright_purple(&self) -> BgColorDisplay<'_, BrightMagenta, Self>
fn on_bright_purple(&self) -> BgColorDisplay<'_, BrightMagenta, Self>
Source§fn bright_cyan(&self) -> FgColorDisplay<'_, BrightCyan, Self>
fn bright_cyan(&self) -> FgColorDisplay<'_, BrightCyan, Self>
Source§fn on_bright_cyan(&self) -> BgColorDisplay<'_, BrightCyan, Self>
fn on_bright_cyan(&self) -> BgColorDisplay<'_, BrightCyan, Self>
Source§fn bright_white(&self) -> FgColorDisplay<'_, BrightWhite, Self>
fn bright_white(&self) -> FgColorDisplay<'_, BrightWhite, Self>
Source§fn on_bright_white(&self) -> BgColorDisplay<'_, BrightWhite, Self>
fn on_bright_white(&self) -> BgColorDisplay<'_, BrightWhite, Self>
Source§fn bold(&self) -> BoldDisplay<'_, Self>
fn bold(&self) -> BoldDisplay<'_, Self>
Source§fn dimmed(&self) -> DimDisplay<'_, Self>
fn dimmed(&self) -> DimDisplay<'_, Self>
Source§fn italic(&self) -> ItalicDisplay<'_, Self>
fn italic(&self) -> ItalicDisplay<'_, Self>
Source§fn underline(&self) -> UnderlineDisplay<'_, Self>
fn underline(&self) -> UnderlineDisplay<'_, Self>
Source§fn blink(&self) -> BlinkDisplay<'_, Self>
fn blink(&self) -> BlinkDisplay<'_, Self>
Source§fn blink_fast(&self) -> BlinkFastDisplay<'_, Self>
fn blink_fast(&self) -> BlinkFastDisplay<'_, Self>
Source§fn reversed(&self) -> ReversedDisplay<'_, Self>
fn reversed(&self) -> ReversedDisplay<'_, Self>
Source§fn strikethrough(&self) -> StrikeThroughDisplay<'_, Self>
fn strikethrough(&self) -> StrikeThroughDisplay<'_, Self>
Source§fn color<Color>(&self, color: Color) -> FgDynColorDisplay<'_, Color, Self>where
Color: DynColor,
fn color<Color>(&self, color: Color) -> FgDynColorDisplay<'_, Color, Self>where
Color: DynColor,
OwoColorize::fg or
a color-specific method, such as OwoColorize::green, Read moreSource§fn on_color<Color>(&self, color: Color) -> BgDynColorDisplay<'_, Color, Self>where
Color: DynColor,
fn on_color<Color>(&self, color: Color) -> BgDynColorDisplay<'_, Color, Self>where
Color: DynColor,
OwoColorize::bg or
a color-specific method, such as OwoColorize::on_yellow, Read more