pub struct UnrestrictiveUrl<'a> {
pub fragment: Option<&'a str>,
pub host: Option<Host<&'a str>>,
pub password: Option<&'a str>,
pub path: Option<&'a str>,
pub port: Option<u16>,
pub query: Option<&'a str>,
pub scheme: Option<&'a str>,
pub username: Option<&'a str>,
/* private fields */
}Expand description
A small wrapper around url::Url that allows free URL modifications.
Since the url crate strictly follows the WHATWG specification, some operations are deemed illegal and can’t be performed with the crate. This crate allows such operations.
§Example
use unrestrictive_url::{Url, UnrestrictiveUrl};
let url = Url::parse("https://github.com").unwrap();
let mut url = UnrestrictiveUrl::from(&url);
url.scheme = Some("jojo");
assert_eq!("jojo://github.com/", url.to_string());Fields§
§fragment: Option<&'a str>§host: Option<Host<&'a str>>§password: Option<&'a str>§path: Option<&'a str>§port: Option<u16>§query: Option<&'a str>§scheme: Option<&'a str>§username: Option<&'a str>Implementations§
Source§impl<'a> UnrestrictiveUrl<'a>
impl<'a> UnrestrictiveUrl<'a>
pub fn path_segments(&self) -> Option<Split<'a, char>>
Trait Implementations§
Source§impl Display for UnrestrictiveUrl<'_>
impl Display for UnrestrictiveUrl<'_>
Auto Trait Implementations§
impl<'a> Freeze for UnrestrictiveUrl<'a>
impl<'a> RefUnwindSafe for UnrestrictiveUrl<'a>
impl<'a> Send for UnrestrictiveUrl<'a>
impl<'a> Sync for UnrestrictiveUrl<'a>
impl<'a> Unpin for UnrestrictiveUrl<'a>
impl<'a> UnwindSafe for UnrestrictiveUrl<'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