Struct strong::Strong [−][src]
Strongly typed str
Implementations
impl<Ctx: Validator> Strong<Ctx>
[src]
pub fn validate<S: AsRef<str> + ?Sized>(s: &S) -> Result<&Self, Ctx::Err>
[src]
Constructs from str
.
pub unsafe fn no_validate<S: AsRef<str> + ?Sized>(s: &S) -> &Self
[src]
pub fn as_str(&self) -> &str
[src]
Converts to str
.
pub fn as_bytes(&self) -> &[u8]
[src]
impl<Ctx: Validator> Strong<Ctx>
[src]
pub fn valid(&self) -> Result<&Self, Ctx::Err>
[src]
Re-validates self
pub fn to_strong_buf(&self) -> StrongBuf<Ctx>
[src]
Converts to StrongBuf
.
pub fn count_chars(&self) -> usize
[src]
pub fn map<F>(&self, f: F) -> Result<&Strong<Ctx>, Ctx::Err> where
F: FnOnce(&str) -> &str,
[src]
F: FnOnce(&str) -> &str,
Map with function: &str -> &str and validation
pub fn trim(&self) -> Result<&Strong<Ctx>, Ctx::Err>
[src]
pub fn trim_start(&self) -> Result<&Strong<Ctx>, Ctx::Err>
[src]
pub fn trim_end(&self) -> Result<&Strong<Ctx>, Ctx::Err>
[src]
Trait Implementations
impl<'expr, Ctx: Validator> AsExpression<Nullable<SqlStrong<Ctx>>> for &'expr Strong<Ctx>
[src]
type Expression = Bound<Nullable<SqlStrong<Ctx>>, Self>
The expression being returned
fn as_expression(self) -> Self::Expression
[src]
impl<'expr, Ctx: Validator> AsExpression<SqlStrong<Ctx>> for &'expr Strong<Ctx>
[src]
type Expression = Bound<SqlStrong<Ctx>, Self>
The expression being returned
fn as_expression(self) -> Self::Expression
[src]
impl<Ctx> AsRef<Strong<Ctx>> for StrongBuf<Ctx> where
Ctx: Validator,
[src]
Ctx: Validator,
impl<Ctx> Borrow<Strong<Ctx>> for StrongBuf<Ctx> where
Ctx: Validator,
[src]
Ctx: Validator,
impl<Ctx> Debug for Strong<Ctx> where
Ctx: Validator + DebugTransparent,
[src]
Ctx: Validator + DebugTransparent,
impl<'de, Ctx> Deserialize<'de> for &'de Strong<Ctx> where
Ctx: Validator,
Ctx::Err: Display,
[src]
Ctx: Validator,
Ctx::Err: Display,
fn deserialize<D>(deserializer: D) -> Result<Self, D::Error> where
D: Deserializer<'de>,
[src]
D: Deserializer<'de>,
impl<Ctx> Display for Strong<Ctx> where
Ctx: Validator + DisplayTransparent,
[src]
Ctx: Validator + DisplayTransparent,
impl<Ctx> Eq for Strong<Ctx> where
Ctx: Validator + PartialEqTransparent + EqTransparent,
[src]
Ctx: Validator + PartialEqTransparent + EqTransparent,
impl<Ctx: HashTransparent> Hash for Strong<Ctx> where
Ctx: Validator,
[src]
Ctx: Validator,
fn hash<H: Hasher>(&self, h: &mut H)
[src]
pub fn hash_slice<H>(data: &[Self], state: &mut H) where
H: Hasher,
1.3.0[src]
H: Hasher,
impl<Ctx> Ord for Strong<Ctx> where
Ctx: Validator + PartialEqTransparent + EqTransparent + PartialOrdTransparent + OrdTransparent,
[src]
Ctx: Validator + PartialEqTransparent + EqTransparent + PartialOrdTransparent + OrdTransparent,
fn cmp(&self, other: &Strong<Ctx>) -> Ordering
[src]
#[must_use]pub fn max(self, other: Self) -> Self
1.21.0[src]
#[must_use]pub fn min(self, other: Self) -> Self
1.21.0[src]
#[must_use]pub fn clamp(self, min: Self, max: Self) -> Self
1.50.0[src]
impl<'a, 'b, Ctx> PartialEq<&'a Strong<Ctx>> for StrongBuf<Ctx> where
Ctx: Validator + PartialEqTransparent,
[src]
Ctx: Validator + PartialEqTransparent,
fn eq(&self, other: &&'a Strong<Ctx>) -> bool
[src]
#[must_use]pub fn ne(&self, other: &Rhs) -> bool
1.0.0[src]
impl<'a, 'b, Ctx> PartialEq<Cow<'a, Strong<Ctx>>> for Strong<Ctx> where
Ctx: Validator + PartialEqTransparent,
[src]
Ctx: Validator + PartialEqTransparent,
fn eq(&self, other: &Cow<'a, Strong<Ctx>>) -> bool
[src]
#[must_use]pub fn ne(&self, other: &Rhs) -> bool
1.0.0[src]
impl<'a, 'b, Ctx> PartialEq<Cow<'a, Strong<Ctx>>> for &'b Strong<Ctx> where
Ctx: Validator + PartialEqTransparent,
[src]
Ctx: Validator + PartialEqTransparent,
fn eq(&self, other: &Cow<'a, Strong<Ctx>>) -> bool
[src]
#[must_use]pub fn ne(&self, other: &Rhs) -> bool
1.0.0[src]
impl<Ctx> PartialEq<Strong<Ctx>> for Strong<Ctx> where
Ctx: Validator + PartialEqTransparent,
[src]
Ctx: Validator + PartialEqTransparent,
fn eq(&self, other: &Strong<Ctx>) -> bool
[src]
#[must_use]pub fn ne(&self, other: &Rhs) -> bool
1.0.0[src]
impl<'a, 'b, Ctx> PartialEq<Strong<Ctx>> for StrongBuf<Ctx> where
Ctx: Validator + PartialEqTransparent,
[src]
Ctx: Validator + PartialEqTransparent,
fn eq(&self, other: &Strong<Ctx>) -> bool
[src]
#[must_use]pub fn ne(&self, other: &Rhs) -> bool
1.0.0[src]
impl<'a, 'b, Ctx> PartialEq<StrongBuf<Ctx>> for Strong<Ctx> where
Ctx: Validator + PartialEqTransparent,
[src]
Ctx: Validator + PartialEqTransparent,
fn eq(&self, other: &StrongBuf<Ctx>) -> bool
[src]
#[must_use]pub fn ne(&self, other: &Rhs) -> bool
1.0.0[src]
impl<'a, 'b, Ctx> PartialEq<StrongBuf<Ctx>> for &'a Strong<Ctx> where
Ctx: Validator + PartialEqTransparent,
[src]
Ctx: Validator + PartialEqTransparent,
fn eq(&self, other: &StrongBuf<Ctx>) -> bool
[src]
#[must_use]pub fn ne(&self, other: &Rhs) -> bool
1.0.0[src]
impl<'a, 'b, Ctx> PartialOrd<&'a Strong<Ctx>> for StrongBuf<Ctx> where
Ctx: Validator + PartialEqTransparent + PartialOrdTransparent,
[src]
Ctx: Validator + PartialEqTransparent + PartialOrdTransparent,
fn partial_cmp(&self, other: &&'a Strong<Ctx>) -> Option<Ordering>
[src]
#[must_use]pub fn lt(&self, other: &Rhs) -> bool
1.0.0[src]
#[must_use]pub fn le(&self, other: &Rhs) -> bool
1.0.0[src]
#[must_use]pub fn gt(&self, other: &Rhs) -> bool
1.0.0[src]
#[must_use]pub fn ge(&self, other: &Rhs) -> bool
1.0.0[src]
impl<'a, 'b, Ctx> PartialOrd<Cow<'a, Strong<Ctx>>> for Strong<Ctx> where
Ctx: Validator + PartialEqTransparent + PartialOrdTransparent,
[src]
Ctx: Validator + PartialEqTransparent + PartialOrdTransparent,
fn partial_cmp(&self, other: &Cow<'a, Strong<Ctx>>) -> Option<Ordering>
[src]
#[must_use]pub fn lt(&self, other: &Rhs) -> bool
1.0.0[src]
#[must_use]pub fn le(&self, other: &Rhs) -> bool
1.0.0[src]
#[must_use]pub fn gt(&self, other: &Rhs) -> bool
1.0.0[src]
#[must_use]pub fn ge(&self, other: &Rhs) -> bool
1.0.0[src]
impl<'a, 'b, Ctx> PartialOrd<Cow<'a, Strong<Ctx>>> for &'b Strong<Ctx> where
Ctx: Validator + PartialEqTransparent + PartialOrdTransparent,
[src]
Ctx: Validator + PartialEqTransparent + PartialOrdTransparent,
fn partial_cmp(&self, other: &Cow<'a, Strong<Ctx>>) -> Option<Ordering>
[src]
#[must_use]pub fn lt(&self, other: &Rhs) -> bool
1.0.0[src]
#[must_use]pub fn le(&self, other: &Rhs) -> bool
1.0.0[src]
#[must_use]pub fn gt(&self, other: &Rhs) -> bool
1.0.0[src]
#[must_use]pub fn ge(&self, other: &Rhs) -> bool
1.0.0[src]
impl<Ctx> PartialOrd<Strong<Ctx>> for Strong<Ctx> where
Ctx: Validator + PartialEqTransparent + PartialOrdTransparent,
[src]
Ctx: Validator + PartialEqTransparent + PartialOrdTransparent,
fn partial_cmp(&self, other: &Strong<Ctx>) -> Option<Ordering>
[src]
#[must_use]pub fn lt(&self, other: &Rhs) -> bool
1.0.0[src]
#[must_use]pub fn le(&self, other: &Rhs) -> bool
1.0.0[src]
#[must_use]pub fn gt(&self, other: &Rhs) -> bool
1.0.0[src]
#[must_use]pub fn ge(&self, other: &Rhs) -> bool
1.0.0[src]
impl<'a, 'b, Ctx> PartialOrd<Strong<Ctx>> for StrongBuf<Ctx> where
Ctx: Validator + PartialEqTransparent + PartialOrdTransparent,
[src]
Ctx: Validator + PartialEqTransparent + PartialOrdTransparent,
fn partial_cmp(&self, other: &Strong<Ctx>) -> Option<Ordering>
[src]
#[must_use]pub fn lt(&self, other: &Rhs) -> bool
1.0.0[src]
#[must_use]pub fn le(&self, other: &Rhs) -> bool
1.0.0[src]
#[must_use]pub fn gt(&self, other: &Rhs) -> bool
1.0.0[src]
#[must_use]pub fn ge(&self, other: &Rhs) -> bool
1.0.0[src]
impl<'a, 'b, Ctx> PartialOrd<StrongBuf<Ctx>> for Strong<Ctx> where
Ctx: Validator + PartialEqTransparent + PartialOrdTransparent,
[src]
Ctx: Validator + PartialEqTransparent + PartialOrdTransparent,
fn partial_cmp(&self, other: &StrongBuf<Ctx>) -> Option<Ordering>
[src]
#[must_use]pub fn lt(&self, other: &Rhs) -> bool
1.0.0[src]
#[must_use]pub fn le(&self, other: &Rhs) -> bool
1.0.0[src]
#[must_use]pub fn gt(&self, other: &Rhs) -> bool
1.0.0[src]
#[must_use]pub fn ge(&self, other: &Rhs) -> bool
1.0.0[src]
impl<'a, 'b, Ctx> PartialOrd<StrongBuf<Ctx>> for &'a Strong<Ctx> where
Ctx: Validator + PartialEqTransparent + PartialOrdTransparent,
[src]
Ctx: Validator + PartialEqTransparent + PartialOrdTransparent,
fn partial_cmp(&self, other: &StrongBuf<Ctx>) -> Option<Ordering>
[src]
#[must_use]pub fn lt(&self, other: &Rhs) -> bool
1.0.0[src]
#[must_use]pub fn le(&self, other: &Rhs) -> bool
1.0.0[src]
#[must_use]pub fn gt(&self, other: &Rhs) -> bool
1.0.0[src]
#[must_use]pub fn ge(&self, other: &Rhs) -> bool
1.0.0[src]
impl<Ctx> Serialize for Strong<Ctx> where
Ctx: Validator,
[src]
Ctx: Validator,
impl<Ctx> ToOwned for Strong<Ctx> where
Ctx: Validator,
[src]
Ctx: Validator,
type Owned = StrongBuf<Ctx>
The resulting type after obtaining ownership.
fn to_owned(&self) -> StrongBuf<Ctx>
[src]
pub fn clone_into(&self, target: &mut Self::Owned)
[src]
impl<Ctx: Validator, __DB> ToSql<Nullable<SqlStrong<Ctx>>, __DB> for Strong<Ctx> where
__DB: Backend,
Self: ToSql<SqlStrong<Ctx>, __DB>,
[src]
__DB: Backend,
Self: ToSql<SqlStrong<Ctx>, __DB>,
impl<Ctx, DB> ToSql<SqlStrong<Ctx>, DB> for Strong<Ctx> where
Ctx: Validator + DebugTransparent,
DB: Backend,
[src]
Ctx: Validator + DebugTransparent,
DB: Backend,
impl<'a, Ctx> TryFrom<&'a str> for &'a Strong<Ctx> where
Ctx: Validator,
[src]
Ctx: Validator,
Auto Trait Implementations
impl<Ctx> RefUnwindSafe for Strong<Ctx> where
Ctx: RefUnwindSafe,
Ctx: RefUnwindSafe,
impl<Ctx> Send for Strong<Ctx> where
Ctx: Send,
Ctx: Send,
impl<Ctx> !Sized for Strong<Ctx>
impl<Ctx> Sync for Strong<Ctx> where
Ctx: Sync,
Ctx: Sync,
impl<Ctx> Unpin for Strong<Ctx> where
Ctx: Unpin,
Ctx: Unpin,
impl<Ctx> UnwindSafe for Strong<Ctx> where
Ctx: UnwindSafe,
Ctx: UnwindSafe,
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,
pub 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> IntoSql for T
[src]
pub fn into_sql<T>(self) -> Self::Expression where
Self: AsExpression<T>,
[src]
Self: AsExpression<T>,
pub fn as_sql<'a, T>(&'a self) -> <&'a Self as AsExpression<T>>::Expression where
&'a Self: AsExpression<T>,
[src]
&'a Self: AsExpression<T>,
impl<T> ToString for T where
T: Display + ?Sized,
[src]
T: Display + ?Sized,
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.
pub 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>,