Struct Strong
#[repr(transparent)]pub struct Strong<Ctx>where
Ctx: Validator,{
phantom: PhantomData<Ctx>,
inner: str,
}Expand description
Strongly typed str
Fields§
§phantom: PhantomData<Ctx>§inner: strImplementations§
§impl<Ctx> Strong<Ctx>where
Ctx: Validator,
impl<Ctx> Strong<Ctx>where
Ctx: Validator,
§impl<Ctx> Strong<Ctx>where
Ctx: Validator,
impl<Ctx> Strong<Ctx>where
Ctx: Validator,
pub fn to_strong_buf(&self) -> StrongBuf<Ctx>
pub fn to_strong_buf(&self) -> StrongBuf<Ctx>
Converts to StrongBuf.
pub fn count_chars(&self) -> usize
pub fn map<F>(&self, f: F) -> Result<&Strong<Ctx>, <Ctx as Validator>::Err>
pub fn map<F>(&self, f: F) -> Result<&Strong<Ctx>, <Ctx as Validator>::Err>
Map with function: &str -> &str and validation
pub fn trim(&self) -> Result<&Strong<Ctx>, <Ctx as Validator>::Err>
pub fn trim_start(&self) -> Result<&Strong<Ctx>, <Ctx as Validator>::Err>
pub fn trim_end(&self) -> Result<&Strong<Ctx>, <Ctx as Validator>::Err>
Trait Implementations§
§impl<Ctx> Debug for Strong<Ctx>where
Ctx: Validator + DebugTransparent,
impl<Ctx> Debug for Strong<Ctx>where
Ctx: Validator + DebugTransparent,
§impl<'de, Ctx> Deserialize<'de> for &'de Strong<Ctx>
impl<'de, Ctx> Deserialize<'de> for &'de Strong<Ctx>
§fn deserialize<D>(
deserializer: D,
) -> Result<&'de Strong<Ctx>, <D as Deserializer<'de>>::Error>where
D: Deserializer<'de>,
fn deserialize<D>(
deserializer: D,
) -> Result<&'de Strong<Ctx>, <D as Deserializer<'de>>::Error>where
D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
§impl<Ctx> Display for Strong<Ctx>where
Ctx: Validator + DisplayTransparent,
impl<Ctx> Display for Strong<Ctx>where
Ctx: Validator + DisplayTransparent,
§impl<Ctx> Hash for Strong<Ctx>where
Ctx: HashTransparent + Validator,
impl<Ctx> Hash for Strong<Ctx>where
Ctx: HashTransparent + Validator,
§impl<Ctx> Ord for Strong<Ctx>where
Ctx: Validator + PartialEqTransparent + EqTransparent + PartialOrdTransparent + OrdTransparent,
impl<Ctx> Ord for Strong<Ctx>where
Ctx: Validator + PartialEqTransparent + EqTransparent + PartialOrdTransparent + OrdTransparent,
§impl<'a, 'b, Ctx> PartialEq<&'a Strong<Ctx>> for StrongBuf<Ctx>where
Ctx: Validator + PartialEqTransparent,
impl<'a, 'b, Ctx> PartialEq<&'a Strong<Ctx>> for StrongBuf<Ctx>where
Ctx: Validator + PartialEqTransparent,
§impl<'a, 'b, Ctx> PartialEq<Cow<'a, Strong<Ctx>>> for &'b Strong<Ctx>where
Ctx: Validator + PartialEqTransparent,
impl<'a, 'b, Ctx> PartialEq<Cow<'a, Strong<Ctx>>> for &'b Strong<Ctx>where
Ctx: Validator + PartialEqTransparent,
§impl<'a, 'b, Ctx> PartialEq<Cow<'a, Strong<Ctx>>> for Strong<Ctx>where
Ctx: Validator + PartialEqTransparent,
impl<'a, 'b, Ctx> PartialEq<Cow<'a, Strong<Ctx>>> for Strong<Ctx>where
Ctx: Validator + PartialEqTransparent,
§impl<'a, 'b, Ctx> PartialEq<Strong<Ctx>> for StrongBuf<Ctx>where
Ctx: Validator + PartialEqTransparent,
impl<'a, 'b, Ctx> PartialEq<Strong<Ctx>> for StrongBuf<Ctx>where
Ctx: Validator + PartialEqTransparent,
§impl<'a, 'b, Ctx> PartialEq<StrongBuf<Ctx>> for &'a Strong<Ctx>where
Ctx: Validator + PartialEqTransparent,
impl<'a, 'b, Ctx> PartialEq<StrongBuf<Ctx>> for &'a Strong<Ctx>where
Ctx: Validator + PartialEqTransparent,
§impl<'a, 'b, Ctx> PartialEq<StrongBuf<Ctx>> for Strong<Ctx>where
Ctx: Validator + PartialEqTransparent,
impl<'a, 'b, Ctx> PartialEq<StrongBuf<Ctx>> for Strong<Ctx>where
Ctx: Validator + PartialEqTransparent,
§impl<Ctx> PartialEq for Strong<Ctx>where
Ctx: Validator + PartialEqTransparent,
impl<Ctx> PartialEq for Strong<Ctx>where
Ctx: Validator + PartialEqTransparent,
§impl<'a, 'b, Ctx> PartialOrd<&'a Strong<Ctx>> for StrongBuf<Ctx>
impl<'a, 'b, Ctx> PartialOrd<&'a Strong<Ctx>> for StrongBuf<Ctx>
§impl<'a, 'b, Ctx> PartialOrd<Cow<'a, Strong<Ctx>>> for &'b Strong<Ctx>
impl<'a, 'b, Ctx> PartialOrd<Cow<'a, Strong<Ctx>>> for &'b Strong<Ctx>
§impl<'a, 'b, Ctx> PartialOrd<Cow<'a, Strong<Ctx>>> for Strong<Ctx>
impl<'a, 'b, Ctx> PartialOrd<Cow<'a, Strong<Ctx>>> for Strong<Ctx>
§impl<'a, 'b, Ctx> PartialOrd<Strong<Ctx>> for StrongBuf<Ctx>
impl<'a, 'b, Ctx> PartialOrd<Strong<Ctx>> for StrongBuf<Ctx>
§impl<'a, 'b, Ctx> PartialOrd<StrongBuf<Ctx>> for &'a Strong<Ctx>
impl<'a, 'b, Ctx> PartialOrd<StrongBuf<Ctx>> for &'a Strong<Ctx>
§impl<'a, 'b, Ctx> PartialOrd<StrongBuf<Ctx>> for Strong<Ctx>
impl<'a, 'b, Ctx> PartialOrd<StrongBuf<Ctx>> for Strong<Ctx>
§impl<Ctx> PartialOrd for Strong<Ctx>
impl<Ctx> PartialOrd for Strong<Ctx>
§impl<Ctx> Serialize for Strong<Ctx>where
Ctx: Validator,
impl<Ctx> Serialize for Strong<Ctx>where
Ctx: Validator,
§fn serialize<S>(
&self,
serializer: S,
) -> Result<<S as Serializer>::Ok, <S as Serializer>::Error>where
S: Serializer,
fn serialize<S>(
&self,
serializer: S,
) -> Result<<S as Serializer>::Ok, <S as Serializer>::Error>where
S: Serializer,
Serialize this value into the given Serde serializer. Read more
§impl<Ctx> ToOwned for Strong<Ctx>where
Ctx: Validator,
impl<Ctx> ToOwned for Strong<Ctx>where
Ctx: Validator,
impl<Ctx> Eq for Strong<Ctx>
Auto Trait Implementations§
impl<Ctx> Freeze for Strong<Ctx>
impl<Ctx> RefUnwindSafe for Strong<Ctx>where
Ctx: RefUnwindSafe,
impl<Ctx> Send for Strong<Ctx>where
Ctx: Send,
impl<Ctx> !Sized for Strong<Ctx>
impl<Ctx> Sync for Strong<Ctx>where
Ctx: Sync,
impl<Ctx> Unpin for Strong<Ctx>where
Ctx: Unpin,
impl<Ctx> UnwindSafe for Strong<Ctx>where
Ctx: UnwindSafe,
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
§impl<Q, K> Comparable<K> for Q
impl<Q, K> Comparable<K> for Q
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Checks if this value is equivalent to the given key. Read more
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.