pub struct UrlScheme(/* private fields */);
Expand description
A URL scheme.
Implementations§
Source§impl UrlScheme
impl UrlScheme
Sourcepub fn new(
url_scheme: impl AsRef<str> + Into<String>,
) -> Result<Self, ParseError>
pub fn new( url_scheme: impl AsRef<str> + Into<String>, ) -> Result<Self, ParseError>
Creates a UrlScheme
from a String
, returning an Err
if the string fails
validation. The string must be non-empty and no more than 100 characters
in length. It must start with a lowercase ASCII letter (a-z),
and contain only lowercase ASCII letters, digits, +
, -
, and .
.
Sourcepub fn validate(url_scheme: &str) -> Result<(), ParseError>
pub fn validate(url_scheme: &str) -> Result<(), ParseError>
Validates url_scheme
but does not construct a new UrlScheme
object.
See UrlScheme::new
for validation details.
pub fn as_str(&self) -> &str
Trait Implementations§
Source§impl<'de> Deserialize<'de> for UrlScheme
impl<'de> Deserialize<'de> for UrlScheme
Source§fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>where
D: Deserializer<'de>,
fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>where
D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
impl Eq for UrlScheme
impl StructuralPartialEq for UrlScheme
Auto Trait Implementations§
impl Freeze for UrlScheme
impl RefUnwindSafe for UrlScheme
impl Send for UrlScheme
impl Sync for UrlScheme
impl Unpin for UrlScheme
impl UnwindSafe for UrlScheme
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,
Source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit
)