Struct Str
pub struct Str<Ctx>where
Ctx: Validator,{
phantom: PhantomData<Ctx>,
inner: String,
}Expand description
Strongly typed String
Fields§
§phantom: PhantomData<Ctx>§inner: StringImplementations§
§impl<Ctx> StrongBuf<Ctx>where
Ctx: Validator,
impl<Ctx> StrongBuf<Ctx>where
Ctx: Validator,
§impl<Ctx> StrongBuf<Ctx>where
Ctx: Validator,
impl<Ctx> StrongBuf<Ctx>where
Ctx: Validator,
pub unsafe fn from_utf8_unchecked(bytes: Vec<u8>) -> StrongBuf<Ctx>
pub unsafe fn from_utf8_unchecked(bytes: Vec<u8>) -> StrongBuf<Ctx>
pub fn into_boxed_strong(self) -> Box<Strong<Ctx>>
Methods from Deref<Target = Strong<Ctx>>§
pub fn as_bytes(&self) -> &[u8] ⓘ
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 StrongBuf<Ctx>where
Ctx: Validator + DebugTransparent,
impl<Ctx> Debug for StrongBuf<Ctx>where
Ctx: Validator + DebugTransparent,
§impl<'de, Ctx> Deserialize<'de> for StrongBuf<Ctx>
impl<'de, Ctx> Deserialize<'de> for StrongBuf<Ctx>
§fn deserialize<D>(
deserializer: D,
) -> Result<StrongBuf<Ctx>, <D as Deserializer<'de>>::Error>where
D: Deserializer<'de>,
fn deserialize<D>(
deserializer: D,
) -> Result<StrongBuf<Ctx>, <D as Deserializer<'de>>::Error>where
D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
§impl<Ctx> Display for StrongBuf<Ctx>where
Ctx: Validator + DisplayTransparent,
impl<Ctx> Display for StrongBuf<Ctx>where
Ctx: Validator + DisplayTransparent,
§impl<Ctx> Hash for StrongBuf<Ctx>where
Ctx: HashTransparent + Validator,
impl<Ctx> Hash for StrongBuf<Ctx>where
Ctx: HashTransparent + Validator,
§impl<Ctx> Ord for StrongBuf<Ctx>where
Ctx: Validator + PartialEqTransparent + EqTransparent + PartialOrdTransparent + OrdTransparent,
impl<Ctx> Ord for StrongBuf<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 StrongBuf<Ctx>where
Ctx: Validator + PartialEqTransparent,
impl<'a, 'b, Ctx> PartialEq<Cow<'a, 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<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 StrongBuf<Ctx>where
Ctx: Validator + PartialEqTransparent,
impl<Ctx> PartialEq for StrongBuf<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 StrongBuf<Ctx>
impl<'a, 'b, Ctx> PartialOrd<Cow<'a, Strong<Ctx>>> for StrongBuf<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 StrongBuf<Ctx>
impl<Ctx> PartialOrd for StrongBuf<Ctx>
§impl<Ctx> Serialize for StrongBuf<Ctx>where
Ctx: Validator,
impl<Ctx> Serialize for StrongBuf<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> Eq for StrongBuf<Ctx>
Auto Trait Implementations§
impl<Ctx> Freeze for StrongBuf<Ctx>
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§
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§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.