pub struct DurationValidatorBuilder<S: State = Empty> { /* private fields */ }Expand description
Builder for DurationValidator.
Implementations§
Source§impl<S: State> DurationValidatorBuilder<S>
impl<S: State> DurationValidatorBuilder<S>
Sourcepub fn with_error_messages(
self,
error_messages: impl IntoIterator<Item = (DurationViolation, impl Into<FixedStr>)>,
) -> DurationValidatorBuilder<SetErrorMessages<S>>where
S::ErrorMessages: IsUnset,
pub fn with_error_messages(
self,
error_messages: impl IntoIterator<Item = (DurationViolation, impl Into<FixedStr>)>,
) -> DurationValidatorBuilder<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 cel(self, program: CelProgram) -> DurationValidatorBuilder<S>
pub fn cel(self, program: CelProgram) -> DurationValidatorBuilder<S>
Adds a CelProgram to this validator.
Sourcepub fn ignore_always(self) -> DurationValidatorBuilder<SetIgnore<S>>where
S::Ignore: IsUnset,
pub fn ignore_always(self) -> DurationValidatorBuilder<SetIgnore<S>>where
S::Ignore: IsUnset,
Specifies that this validator should always be ignored.
Sourcepub fn required(self) -> DurationValidatorBuilder<SetRequired<S>>where
S::Required: IsUnset,
pub fn required(self) -> DurationValidatorBuilder<SetRequired<S>>where
S::Required: IsUnset,
Specifies that the field must be set in order to be valid.
Sourcepub fn in_(
self,
val: impl IntoSortedList<Duration>,
) -> DurationValidatorBuilder<SetIn<S>>where
S::In: IsUnset,
pub fn in_(
self,
val: impl IntoSortedList<Duration>,
) -> DurationValidatorBuilder<SetIn<S>>where
S::In: IsUnset,
Specifies that only the values in this list will be considered valid for this field.
Sourcepub fn not_in(
self,
val: impl IntoSortedList<Duration>,
) -> DurationValidatorBuilder<SetNotIn<S>>where
S::NotIn: IsUnset,
pub fn not_in(
self,
val: impl IntoSortedList<Duration>,
) -> DurationValidatorBuilder<SetNotIn<S>>where
S::NotIn: IsUnset,
Specifies that the values in this list will be considered NOT valid for this field.
Sourcepub fn const_(self, val: Duration) -> DurationValidatorBuilder<SetConst<S>>where
S::Const: IsUnset,
pub fn const_(self, val: Duration) -> DurationValidatorBuilder<SetConst<S>>where
S::Const: IsUnset,
Specifies that only this specific value will be considered valid for this field.
Sourcepub fn lt(self, val: Duration) -> DurationValidatorBuilder<SetLt<S>>where
S::Lt: IsUnset,
pub fn lt(self, val: Duration) -> DurationValidatorBuilder<SetLt<S>>where
S::Lt: IsUnset,
Specifies that the duration must be shorter than the indicated amount in order to pass validation.
Sourcepub fn lte(self, val: Duration) -> DurationValidatorBuilder<SetLte<S>>where
S::Lte: IsUnset,
pub fn lte(self, val: Duration) -> DurationValidatorBuilder<SetLte<S>>where
S::Lte: IsUnset,
Specifies that the duration must be equal to or shorter than the indicated amount in order to pass validation.
Sourcepub fn gt(self, val: Duration) -> DurationValidatorBuilder<SetGt<S>>where
S::Gt: IsUnset,
pub fn gt(self, val: Duration) -> DurationValidatorBuilder<SetGt<S>>where
S::Gt: IsUnset,
Specifies that the duration must be longer than the indicated amount in order to pass validation.
Sourcepub fn gte(self, val: Duration) -> DurationValidatorBuilder<SetGte<S>>where
S::Gte: IsUnset,
pub fn gte(self, val: Duration) -> DurationValidatorBuilder<SetGte<S>>where
S::Gte: IsUnset,
Specifies that the duration must be equal to or longer than the indicated amount in order to pass validation.
Sourcepub fn build(self) -> DurationValidator
pub fn build(self) -> DurationValidator
Builds the validator.
Trait Implementations§
Source§impl<S: Clone + State> Clone for DurationValidatorBuilder<S>
impl<S: Clone + State> Clone for DurationValidatorBuilder<S>
Source§fn clone(&self) -> DurationValidatorBuilder<S>
fn clone(&self) -> DurationValidatorBuilder<S>
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl<S: Debug + State> Debug for DurationValidatorBuilder<S>
impl<S: Debug + State> Debug for DurationValidatorBuilder<S>
Source§impl<S: State> Default for DurationValidatorBuilder<S>
impl<S: State> Default for DurationValidatorBuilder<S>
Source§impl<S: State> From<DurationValidatorBuilder<S>> for ProtoOption
impl<S: State> From<DurationValidatorBuilder<S>> for ProtoOption
Source§fn from(value: DurationValidatorBuilder<S>) -> Self
fn from(value: DurationValidatorBuilder<S>) -> Self
Source§impl<S: Hash + State> Hash for DurationValidatorBuilder<S>
impl<S: Hash + State> Hash for DurationValidatorBuilder<S>
Source§impl<S: PartialEq + State> PartialEq for DurationValidatorBuilder<S>
impl<S: PartialEq + State> PartialEq for DurationValidatorBuilder<S>
Source§impl<S: State> ValidatorBuilderFor<Duration> for DurationValidatorBuilder<S>
impl<S: State> ValidatorBuilderFor<Duration> for DurationValidatorBuilder<S>
type Validator = DurationValidator
Source§fn build_validator(self) -> DurationValidator
fn build_validator(self) -> DurationValidator
Validator.impl<S: Eq + State> Eq for DurationValidatorBuilder<S>
impl<S: State> StructuralPartialEq for DurationValidatorBuilder<S>
Auto Trait Implementations§
impl<S> Freeze for DurationValidatorBuilder<S>
impl<S> RefUnwindSafe for DurationValidatorBuilder<S>where
S: RefUnwindSafe,
impl<S> Send for DurationValidatorBuilder<S>where
S: Send,
impl<S> Sync for DurationValidatorBuilder<S>where
S: Sync,
impl<S> Unpin for DurationValidatorBuilder<S>where
S: Unpin,
impl<S> UnsafeUnpin for DurationValidatorBuilder<S>
impl<S> UnwindSafe for DurationValidatorBuilder<S>where
S: UnwindSafe,
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