use crate::ext::IntoOwned;
use crate::uri::Error;
#[derive(Debug, PartialEq, Eq, Hash, Copy, Clone)]
pub struct Asterisk;
impl Asterisk {
pub fn parse(string: &str) -> Result<Asterisk, Error<'_>> {
crate::parse::uri::asterisk_from_str(string)
}
pub fn parse_owned(string: String) -> Result<Asterisk, Error<'static>> {
Asterisk::parse(&string).map_err(|e| e.into_owned())
}
}
impl std::fmt::Display for Asterisk {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
"*".fmt(f)
}
}
impl_serde!(Asterisk, "an asterisk-form URI, '*'");