Struct strong::StrongBuf [−][src]
Strongly typed String
Implementations
impl<Ctx: Validator> StrongBuf<Ctx>
[src]
pub fn validate(s: String) -> Result<Self, Ctx::Err>
[src]
Constructs from String
.
pub unsafe fn no_validate(s: String) -> Self
[src]
Constructs from String
without validation.
Safety
This function allows us to create invalid StrongBuf
.
pub fn into_string(self) -> String
[src]
Converts to String
.
pub fn as_strong(&self) -> &Strong<Ctx>
[src]
impl<Ctx: Validator> StrongBuf<Ctx>
[src]
pub unsafe fn from_utf8_unchecked(bytes: Vec<u8>) -> Self
[src]
Constructs from Vec<u8>
without validation.
Safety
This function allows us to create invalid StrongBuf
,
and it may not even be a valid utf-8.
pub fn into_boxed_strong(self) -> Box<Strong<Ctx>>
[src]
Methods from Deref<Target = Strong<Ctx>>
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 StrongBuf<Ctx>
[src]
type Expression = Bound<Nullable<SqlStrong<Ctx>>, Self>
The expression being returned
fn as_expression(self) -> Self::Expression
[src]
impl<Ctx: Validator> AsExpression<Nullable<SqlStrong<Ctx>>> for StrongBuf<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 StrongBuf<Ctx>
[src]
type Expression = Bound<SqlStrong<Ctx>, Self>
The expression being returned
fn as_expression(self) -> Self::Expression
[src]
impl<Ctx: Validator> AsExpression<SqlStrong<Ctx>> for StrongBuf<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> Clone for StrongBuf<Ctx> where
Ctx: Validator,
[src]
Ctx: Validator,
fn clone(&self) -> Self
[src]
pub fn clone_from(&mut self, source: &Self)
1.0.0[src]
impl<Ctx> Debug for StrongBuf<Ctx> where
Ctx: Validator + DebugTransparent,
[src]
Ctx: Validator + DebugTransparent,
impl<T> Default for StrongBuf<Name<T>>
[src]
impl<Ctx> Deref for StrongBuf<Ctx> where
Ctx: Validator,
[src]
Ctx: Validator,
type Target = Strong<Ctx>
The resulting type after dereferencing.
fn deref(&self) -> &Strong<Ctx>
[src]
impl<'de, Ctx> Deserialize<'de> for StrongBuf<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 StrongBuf<Ctx> where
Ctx: Validator + DisplayTransparent,
[src]
Ctx: Validator + DisplayTransparent,
impl<Ctx> Eq for StrongBuf<Ctx> where
Ctx: Validator + PartialEqTransparent + EqTransparent,
[src]
Ctx: Validator + PartialEqTransparent + EqTransparent,
impl<Ctx> From<Box<Strong<Ctx>, Global>> for StrongBuf<Ctx> where
Ctx: Validator,
[src]
Ctx: Validator,
impl<'a, Ctx, DB> FromSql<SqlStrong<Ctx>, DB> for StrongBuf<Ctx> where
Ctx: Validator,
Ctx::Err: Error + Send + Sync + 'static,
DB: Backend<RawValue = [u8]>,
String: FromSql<Text, DB>,
[src]
Ctx: Validator,
Ctx::Err: Error + Send + Sync + 'static,
DB: Backend<RawValue = [u8]>,
String: FromSql<Text, DB>,
impl<Ctx: Validator, __ST, __DB> FromSqlRow<__ST, __DB> for StrongBuf<Ctx> where
__DB: Backend,
Self: FromSql<__ST, __DB>,
[src]
__DB: Backend,
Self: FromSql<__ST, __DB>,
fn build_from_row<R: Row<__DB>>(row: &mut R) -> Result<Self>
[src]
pub const FIELDS_NEEDED: usize
[src]
impl<Ctx> FromStr for StrongBuf<Ctx> where
Ctx: Validator,
[src]
Ctx: Validator,
type Err = Ctx::Err
The associated error which can be returned from parsing.
fn from_str(s: &str) -> Result<Self, Self::Err>
[src]
impl<Ctx: HashTransparent> Hash for StrongBuf<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 StrongBuf<Ctx> where
Ctx: Validator + PartialEqTransparent + EqTransparent + PartialOrdTransparent + OrdTransparent,
[src]
Ctx: Validator + PartialEqTransparent + EqTransparent + PartialOrdTransparent + OrdTransparent,
fn cmp(&self, other: &StrongBuf<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 StrongBuf<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<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<Ctx> PartialEq<StrongBuf<Ctx>> for StrongBuf<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 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 StrongBuf<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<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<Ctx> PartialOrd<StrongBuf<Ctx>> for StrongBuf<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 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: Validator, __ST, __DB> Queryable<__ST, __DB> for StrongBuf<Ctx> where
__DB: Backend,
Self: FromSql<__ST, __DB>,
[src]
__DB: Backend,
Self: FromSql<__ST, __DB>,
type Row = Self
The Rust type you’d like to map from. Read more
fn build(row: Self::Row) -> Self
[src]
impl<Ctx> Serialize for StrongBuf<Ctx> where
Ctx: Validator,
[src]
Ctx: Validator,
impl<Ctx: Validator, __DB> ToSql<Nullable<SqlStrong<Ctx>>, __DB> for StrongBuf<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 StrongBuf<Ctx> where
Ctx: Validator + DebugTransparent,
DB: Backend,
[src]
Ctx: Validator + DebugTransparent,
DB: Backend,
impl<Ctx> TryFrom<String> for StrongBuf<Ctx> where
Ctx: Validator,
[src]
Ctx: Validator,
Auto Trait Implementations
impl<Ctx> RefUnwindSafe for StrongBuf<Ctx> where
Ctx: RefUnwindSafe,
Ctx: RefUnwindSafe,
impl<Ctx> Send for StrongBuf<Ctx> where
Ctx: Send,
Ctx: Send,
impl<Ctx> Sync for StrongBuf<Ctx> where
Ctx: Sync,
Ctx: Sync,
impl<Ctx> Unpin for StrongBuf<Ctx> where
Ctx: Unpin,
Ctx: Unpin,
impl<Ctx> UnwindSafe for StrongBuf<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> DeserializeOwned for T where
T: for<'de> Deserialize<'de>,
[src]
T: for<'de> Deserialize<'de>,
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> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
pub fn to_owned(&self) -> T
[src]
pub fn clone_into(&self, target: &mut T)
[src]
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>,