Struct strong::StrongBuf[][src]

pub struct StrongBuf<Ctx: Validator> { /* fields omitted */ }

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 as_str(&self) -> &str[src]

Converts to str.

pub fn as_bytes(&self) -> &[u8][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]

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

impl<Ctx: Validator> AsExpression<Nullable<SqlStrong<Ctx>>> for StrongBuf<Ctx>[src]

type Expression = Bound<Nullable<SqlStrong<Ctx>>, Self>

The expression being returned

impl<'expr, Ctx: Validator> AsExpression<SqlStrong<Ctx>> for &'expr StrongBuf<Ctx>[src]

type Expression = Bound<SqlStrong<Ctx>, Self>

The expression being returned

impl<Ctx: Validator> AsExpression<SqlStrong<Ctx>> for StrongBuf<Ctx>[src]

type Expression = Bound<SqlStrong<Ctx>, Self>

The expression being returned

impl<Ctx> AsRef<Strong<Ctx>> for StrongBuf<Ctx> where
    Ctx: Validator
[src]

impl<Ctx> Borrow<Strong<Ctx>> for StrongBuf<Ctx> where
    Ctx: Validator
[src]

impl<Ctx> Clone for StrongBuf<Ctx> where
    Ctx: Validator
[src]

impl<Ctx> Debug for StrongBuf<Ctx> where
    Ctx: Validator + DebugTransparent
[src]

impl<T> Default for StrongBuf<Name<T>>[src]

impl<Ctx> Deref for StrongBuf<Ctx> where
    Ctx: Validator
[src]

type Target = Strong<Ctx>

The resulting type after dereferencing.

impl<'de, Ctx> Deserialize<'de> for StrongBuf<Ctx> where
    Ctx: Validator,
    Ctx::Err: Display
[src]

impl<Ctx> Display for StrongBuf<Ctx> where
    Ctx: Validator + DisplayTransparent
[src]

impl<Ctx> Eq for StrongBuf<Ctx> where
    Ctx: Validator + PartialEqTransparent + EqTransparent
[src]

impl<Ctx> From<Box<Strong<Ctx>, Global>> for StrongBuf<Ctx> where
    Ctx: Validator
[src]

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]

impl<Ctx: Validator, __ST, __DB> FromSqlRow<__ST, __DB> for StrongBuf<Ctx> where
    __DB: Backend,
    Self: FromSql<__ST, __DB>, 
[src]

impl<Ctx> FromStr for StrongBuf<Ctx> where
    Ctx: Validator
[src]

type Err = Ctx::Err

The associated error which can be returned from parsing.

impl<Ctx: HashTransparent> Hash for StrongBuf<Ctx> where
    Ctx: Validator
[src]

impl<Ctx> Ord for StrongBuf<Ctx> where
    Ctx: Validator + PartialEqTransparent + EqTransparent + PartialOrdTransparent + OrdTransparent
[src]

impl<'a, 'b, Ctx> PartialEq<&'a Strong<Ctx>> for StrongBuf<Ctx> where
    Ctx: Validator + PartialEqTransparent
[src]

impl<'a, 'b, Ctx> PartialEq<Cow<'a, Strong<Ctx>>> for StrongBuf<Ctx> where
    Ctx: Validator + PartialEqTransparent
[src]

impl<'a, 'b, Ctx> PartialEq<Strong<Ctx>> for StrongBuf<Ctx> where
    Ctx: Validator + PartialEqTransparent
[src]

impl<Ctx> PartialEq<StrongBuf<Ctx>> for StrongBuf<Ctx> where
    Ctx: Validator + PartialEqTransparent
[src]

impl<'a, 'b, Ctx> PartialEq<StrongBuf<Ctx>> for Strong<Ctx> where
    Ctx: Validator + PartialEqTransparent
[src]

impl<'a, 'b, Ctx> PartialEq<StrongBuf<Ctx>> for &'a Strong<Ctx> where
    Ctx: Validator + PartialEqTransparent
[src]

impl<'a, 'b, Ctx> PartialOrd<&'a Strong<Ctx>> for StrongBuf<Ctx> where
    Ctx: Validator + PartialEqTransparent + PartialOrdTransparent
[src]

impl<'a, 'b, Ctx> PartialOrd<Cow<'a, Strong<Ctx>>> for StrongBuf<Ctx> where
    Ctx: Validator + PartialEqTransparent + PartialOrdTransparent
[src]

impl<'a, 'b, Ctx> PartialOrd<Strong<Ctx>> for StrongBuf<Ctx> where
    Ctx: Validator + PartialEqTransparent + PartialOrdTransparent
[src]

impl<Ctx> PartialOrd<StrongBuf<Ctx>> for StrongBuf<Ctx> where
    Ctx: Validator + PartialEqTransparent + PartialOrdTransparent
[src]

impl<'a, 'b, Ctx> PartialOrd<StrongBuf<Ctx>> for Strong<Ctx> where
    Ctx: Validator + PartialEqTransparent + PartialOrdTransparent
[src]

impl<'a, 'b, Ctx> PartialOrd<StrongBuf<Ctx>> for &'a Strong<Ctx> where
    Ctx: Validator + PartialEqTransparent + PartialOrdTransparent
[src]

impl<Ctx: Validator, __ST, __DB> Queryable<__ST, __DB> for StrongBuf<Ctx> where
    __DB: Backend,
    Self: FromSql<__ST, __DB>, 
[src]

type Row = Self

The Rust type you’d like to map from. Read more

impl<Ctx> Serialize for StrongBuf<Ctx> where
    Ctx: Validator
[src]

impl<Ctx: Validator, __DB> ToSql<Nullable<SqlStrong<Ctx>>, __DB> for StrongBuf<Ctx> where
    __DB: Backend,
    Self: ToSql<SqlStrong<Ctx>, __DB>, 
[src]

impl<Ctx, DB> ToSql<SqlStrong<Ctx>, DB> for StrongBuf<Ctx> where
    Ctx: Validator + DebugTransparent,
    DB: Backend
[src]

impl<Ctx> TryFrom<String> for StrongBuf<Ctx> where
    Ctx: Validator
[src]

type Error = Ctx::Err

The type returned in the event of a conversion error.

Auto Trait Implementations

impl<Ctx> RefUnwindSafe for StrongBuf<Ctx> where
    Ctx: RefUnwindSafe

impl<Ctx> Send for StrongBuf<Ctx> where
    Ctx: Send

impl<Ctx> Sync for StrongBuf<Ctx> where
    Ctx: Sync

impl<Ctx> Unpin for StrongBuf<Ctx> where
    Ctx: Unpin

impl<Ctx> UnwindSafe for StrongBuf<Ctx> where
    Ctx: UnwindSafe

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> DeserializeOwned for T where
    T: for<'de> Deserialize<'de>, 
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> IntoSql for T[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T> ToString for T where
    T: Display + ?Sized
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.