pub struct Url<'a> {
pub schema: Option<&'a str>,
pub host: Option<&'a str>,
pub port: Option<&'a str>,
pub path: Option<&'a str>,
pub query: Option<&'a str>,
pub fragment: Option<&'a str>,
pub userinfo: Option<&'a str>,
}
Expand description
A parsed URL
Fields§
§schema: Option<&'a str>
§host: Option<&'a str>
§port: Option<&'a str>
§path: Option<&'a str>
§query: Option<&'a str>
§fragment: Option<&'a str>
§userinfo: Option<&'a str>
Implementations§
Source§impl<'a> Url<'a>
impl<'a> Url<'a>
Sourcepub fn parse(buf: &'a str) -> Result<Url<'a>, ParseError>
pub fn parse(buf: &'a str) -> Result<Url<'a>, ParseError>
Parse a URL from a string
§Examples
use url_lite::Url;
let url = Url::parse("http://example.com").expect("Invalid URL");
Sourcepub fn parse_connect(buf: &'a str) -> Result<Url<'a>, ParseError>
pub fn parse_connect(buf: &'a str) -> Result<Url<'a>, ParseError>
Parse as a HTTP CONNECT method URL
Will return an error if the URL contains anything other than hostname and port
Trait Implementations§
impl<'a> Eq for Url<'a>
impl<'a> StructuralPartialEq for Url<'a>
Auto Trait Implementations§
impl<'a> Freeze for Url<'a>
impl<'a> RefUnwindSafe for Url<'a>
impl<'a> Send for Url<'a>
impl<'a> Sync for Url<'a>
impl<'a> Unpin for Url<'a>
impl<'a> UnwindSafe for Url<'a>
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