Skip to main content

AsStr

Trait AsStr 

Source
pub trait AsStr {
    // Required method
    fn as_str_ref(&self) -> &str;
}
Expand description

Trait for types that can be checked against a string pattern. Used by email, url, pattern, and contains validators.

Required Methods§

Source

fn as_str_ref(&self) -> &str

Return this value as a string slice for pattern matching.

Implementations on Foreign Types§

Source§

impl AsStr for &str

Source§

fn as_str_ref(&self) -> &str

Source§

impl AsStr for Cow<'_, str>

Source§

fn as_str_ref(&self) -> &str

Source§

impl AsStr for String

Source§

fn as_str_ref(&self) -> &str

Implementors§