Struct strong::Strong[][src]

#[repr(transparent)]pub struct Strong<Ctx: Validator> { /* fields omitted */ }

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]

Constructs from str without validation.

Safety

This function allows us to create invalid Strong.

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.

Trait Implementations

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

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

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

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

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

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

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

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

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

type Owned = StrongBuf<Ctx>

The resulting type after obtaining ownership.

Auto Trait Implementations

impl<Ctx> RefUnwindSafe for Strong<Ctx> where
    Ctx: RefUnwindSafe
[src]

impl<Ctx> Send for Strong<Ctx> where
    Ctx: Send
[src]

impl<Ctx> !Sized for Strong<Ctx>[src]

impl<Ctx> Sync for Strong<Ctx> where
    Ctx: Sync
[src]

impl<Ctx> Unpin for Strong<Ctx> where
    Ctx: Unpin
[src]

impl<Ctx> UnwindSafe for Strong<Ctx> where
    Ctx: UnwindSafe
[src]

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> From<T> for T[src]

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

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.