[−][src]Struct valid::FieldName
Represents the field level context for validation functions. Its value is the name of the field to be validated.
Implementations
impl FieldName
[src]
pub fn unwrap(self) -> Cow<'static, str>
[src]
Unwraps this field name context and returns the field name itself
Methods from Deref<Target = Cow<'static, str>>
pub fn is_borrowed(&self) -> bool
[src]
🔬 This is a nightly-only experimental API. (
cow_is_borrowed
)Returns true if the data is borrowed, i.e. if to_mut
would require additional work.
Examples
#![feature(cow_is_borrowed)] use std::borrow::Cow; let cow = Cow::Borrowed("moo"); assert!(cow.is_borrowed()); let bull: Cow<'_, str> = Cow::Owned("...moo?".to_string()); assert!(!bull.is_borrowed());
pub fn is_owned(&self) -> bool
[src]
🔬 This is a nightly-only experimental API. (
cow_is_borrowed
)Returns true if the data is owned, i.e. if to_mut
would be a no-op.
Examples
#![feature(cow_is_borrowed)] use std::borrow::Cow; let cow: Cow<'_, str> = Cow::Owned("moo".to_string()); assert!(cow.is_owned()); let bull = Cow::Borrowed("...moo?"); assert!(!bull.is_owned());
Trait Implementations
impl Clone for FieldName
[src]
impl Debug for FieldName
[src]
impl Deref for FieldName
[src]
type Target = Cow<'static, str>
The resulting type after dereferencing.
fn deref(&self) -> &Self::Target
[src]
impl Eq for FieldName
[src]
impl<A> From<A> for FieldName where
A: Into<Cow<'static, str>>,
[src]
A: Into<Cow<'static, str>>,
impl PartialEq<FieldName> for FieldName
[src]
impl StructuralEq for FieldName
[src]
impl StructuralPartialEq for FieldName
[src]
impl<T> Validate<AssertFalse, FieldName> for T where
T: HasCheckedValue,
[src]
T: HasCheckedValue,
fn validate(
self,
name: impl Into<FieldName>,
_constraint: &AssertFalse
) -> Validation<AssertFalse, Self>
[src]
self,
name: impl Into<FieldName>,
_constraint: &AssertFalse
) -> Validation<AssertFalse, Self>
impl<T> Validate<AssertTrue, FieldName> for T where
T: HasCheckedValue,
[src]
T: HasCheckedValue,
fn validate(
self,
name: impl Into<FieldName>,
_constraint: &AssertTrue
) -> Validation<AssertTrue, Self>
[src]
self,
name: impl Into<FieldName>,
_constraint: &AssertTrue
) -> Validation<AssertTrue, Self>
impl<T> Validate<Bound<T>, FieldName> for T where
T: PartialOrd + Clone + Into<Value>,
[src]
T: PartialOrd + Clone + Into<Value>,
fn validate(
self,
name: impl Into<FieldName>,
constraint: &Bound<T>
) -> Validation<Bound<T>, Self>
[src]
self,
name: impl Into<FieldName>,
constraint: &Bound<T>
) -> Validation<Bound<T>, Self>
impl<T> Validate<CharCount, FieldName> for T where
T: HasCharCount,
[src]
T: HasCharCount,
fn validate(
self,
name: impl Into<FieldName>,
constraint: &CharCount
) -> Validation<CharCount, Self>
[src]
self,
name: impl Into<FieldName>,
constraint: &CharCount
) -> Validation<CharCount, Self>
impl<'a, T, A> Validate<Contains<'a, A>, FieldName> for T where
T: HasMember<A> + Into<Value>,
A: Clone + Into<Value>,
[src]
T: HasMember<A> + Into<Value>,
A: Clone + Into<Value>,
fn validate(
self,
name: impl Into<FieldName>,
constraint: &Contains<'a, A>
) -> Validation<Contains<'a, A>, Self>
[src]
self,
name: impl Into<FieldName>,
constraint: &Contains<'a, A>
) -> Validation<Contains<'a, A>, Self>
impl<T> Validate<Digits, FieldName> for T where
T: HasDecimalDigits,
[src]
T: HasDecimalDigits,
fn validate(
self,
name: impl Into<FieldName>,
constraint: &Digits
) -> Validation<Digits, Self>
[src]
self,
name: impl Into<FieldName>,
constraint: &Digits
) -> Validation<Digits, Self>
impl<T> Validate<Length, FieldName> for T where
T: HasLength,
[src]
T: HasLength,
fn validate(
self,
name: impl Into<FieldName>,
constraint: &Length
) -> Validation<Length, Self>
[src]
self,
name: impl Into<FieldName>,
constraint: &Length
) -> Validation<Length, Self>
impl<T> Validate<NonZero, FieldName> for T where
T: HasZeroValue + Into<Value>,
[src]
T: HasZeroValue + Into<Value>,
fn validate(
self,
name: impl Into<FieldName>,
_constraint: &NonZero
) -> Validation<NonZero, Self>
[src]
self,
name: impl Into<FieldName>,
_constraint: &NonZero
) -> Validation<NonZero, Self>
impl<T> Validate<NotEmpty, FieldName> for T where
T: HasEmptyValue,
[src]
T: HasEmptyValue,
fn validate(
self,
name: impl Into<FieldName>,
_constraint: &NotEmpty
) -> Validation<NotEmpty, Self>
[src]
self,
name: impl Into<FieldName>,
_constraint: &NotEmpty
) -> Validation<NotEmpty, Self>
impl Validate<Pattern, FieldName> for String
[src]
Auto Trait Implementations
impl RefUnwindSafe for FieldName
impl Send for FieldName
impl Sync for FieldName
impl Unpin for FieldName
impl UnwindSafe for FieldName
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
fn to_owned(&self) -> T
[src]
fn clone_into(&self, target: &mut T)
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,