pub struct Url { /* private fields */ }
Implementations§
source§impl Url
impl Url
sourcepub fn parse(input: &str, base: Option<&str>) -> Result<Url, Error>
pub fn parse(input: &str, base: Option<&str>) -> Result<Url, Error>
Parses the input with an optional base
use ada_url::Url;
let out = Url::parse("https://ada-url.github.io/ada", None)
.expect("This is a valid URL. Should have parsed it.");
assert_eq!(out.protocol(), "https:");
sourcepub fn can_parse(input: &str, base: Option<&str>) -> bool
pub fn can_parse(input: &str, base: Option<&str>) -> bool
Returns whether or not the URL can be parsed or not.
use ada_url::Url;
assert!(Url::can_parse("https://ada-url.github.io/ada", None));
assert!(Url::can_parse("/pathname", Some("https://ada-url.github.io/ada")));
pub fn origin(&mut self) -> &str
pub fn href(&self) -> &str
pub fn set_href(&mut self, input: &str) -> bool
pub fn username(&self) -> &str
pub fn set_username(&mut self, input: &str) -> bool
pub fn password(&self) -> &str
pub fn set_password(&mut self, input: &str) -> bool
pub fn port(&self) -> &str
pub fn set_port(&mut self, input: &str) -> bool
pub fn hash(&self) -> &str
pub fn set_hash(&mut self, input: &str)
pub fn host(&self) -> &str
pub fn set_host(&mut self, input: &str) -> bool
pub fn hostname(&self) -> &str
pub fn set_hostname(&mut self, input: &str) -> bool
pub fn pathname(&self) -> &str
pub fn set_pathname(&mut self, input: &str) -> bool
pub fn search(&self) -> &str
pub fn set_search(&mut self, input: &str)
pub fn protocol(&self) -> &str
pub fn set_protocol(&mut self, input: &str) -> bool
pub fn has_credentials(&self) -> bool
pub fn has_empty_hostname(&self) -> bool
pub fn has_hostname(&self) -> bool
pub fn has_non_empty_username(&self) -> bool
pub fn has_non_empty_password(&self) -> bool
pub fn has_port(&self) -> bool
pub fn has_password(&self) -> bool
pub fn has_hash(&self) -> bool
pub fn has_search(&self) -> bool
Trait Implementations§
Auto Trait Implementations§
impl RefUnwindSafe for Url
impl !Send for Url
impl !Sync for Url
impl Unpin for Url
impl UnwindSafe for Url
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