pub struct UrlTarget {
pub host: String,
pub port: u16,
pub path: String,
pub secure: bool,
}Expand description
A URL in the pieces WinHttpConnect and WinHttpOpenRequest take.
Fields§
§host: String§port: u16§path: StringPath and query together.
secure: boolImplementations§
Source§impl UrlTarget
impl UrlTarget
Sourcepub fn parse(url: &str) -> Result<UrlTarget, HttpError>
pub fn parse(url: &str) -> Result<UrlTarget, HttpError>
Split by WinHttpCrackUrl, so odd-but-legal URLs divide as the OS stack expects.
Sourcepub fn origin(&self) -> (bool, String, u16)
pub fn origin(&self) -> (bool, String, u16)
Scheme, host and port, which decide whether the token may travel; the
host is lowercased, since EXAMPLE.com and example.com are one origin.
Sourcepub fn resolve(&self, location: &str) -> Result<UrlTarget, HttpError>
pub fn resolve(&self, location: &str) -> Result<UrlTarget, HttpError>
Where a Location header points: absolute, rooted at /, or relative to
the current directory, all three of which happen.
fn scheme(&self) -> &'static str
Auto Trait Implementations§
impl Freeze for UrlTarget
impl RefUnwindSafe for UrlTarget
impl Send for UrlTarget
impl Sync for UrlTarget
impl Unpin for UrlTarget
impl UnsafeUnpin for UrlTarget
impl UnwindSafe for UrlTarget
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