pub struct HttpUrlComponents {
pub protocol: Protocol,
pub host: Option<String>,
pub port: Option<u16>,
pub path: Option<String>,
pub query: Option<String>,
pub fragment: Option<String>,
}Expand description
Represents the components of a parsed HTTP URL.
This struct holds various parts of a URL, including the protocol, host, port, path, query, and fragment, allowing for structured access to URL information.
Fields§
§protocol: ProtocolThe URL scheme, such as “http” or “https”.
host: Option<String>The host part of the URL.
port: Option<u16>The port number in the URL, if specified.
path: Option<String>The path in the URL.
query: Option<String>The query string in the URL.
fragment: Option<String>The fragment identifier.
Implementations§
Source§impl HttpUrlComponents
impl HttpUrlComponents
Sourcepub fn parse<U>(url_str: U) -> Result<Self, HttpUrlError>
pub fn parse<U>(url_str: U) -> Result<Self, HttpUrlError>
Source§impl HttpUrlComponents
impl HttpUrlComponents
pub fn get_protocol(&self) -> &Protocol
pub fn get_mut_protocol(&mut self) -> &mut Protocol
pub fn set_protocol(&mut self, val: Protocol) -> &mut Self
pub fn get_host(&self) -> &Option<String>
pub fn get_mut_host(&mut self) -> &mut Option<String>
pub fn set_host(&mut self, val: Option<String>) -> &mut Self
pub fn get_port(&self) -> &Option<u16>
pub fn get_mut_port(&mut self) -> &mut Option<u16>
pub fn set_port(&mut self, val: Option<u16>) -> &mut Self
pub fn get_path(&self) -> &Option<String>
pub fn get_mut_path(&mut self) -> &mut Option<String>
pub fn set_path(&mut self, val: Option<String>) -> &mut Self
pub fn get_query(&self) -> &Option<String>
pub fn get_mut_query(&mut self) -> &mut Option<String>
pub fn set_query(&mut self, val: Option<String>) -> &mut Self
pub fn get_fragment(&self) -> &Option<String>
pub fn get_mut_fragment(&mut self) -> &mut Option<String>
pub fn set_fragment(&mut self, val: Option<String>) -> &mut Self
Trait Implementations§
Source§impl Clone for HttpUrlComponents
impl Clone for HttpUrlComponents
Source§fn clone(&self) -> HttpUrlComponents
fn clone(&self) -> HttpUrlComponents
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for HttpUrlComponents
impl Debug for HttpUrlComponents
Source§impl Default for HttpUrlComponents
impl Default for HttpUrlComponents
Source§fn default() -> HttpUrlComponents
fn default() -> HttpUrlComponents
Returns the “default value” for a type. Read more
Source§impl PartialEq for HttpUrlComponents
impl PartialEq for HttpUrlComponents
impl Eq for HttpUrlComponents
impl StructuralPartialEq for HttpUrlComponents
Auto Trait Implementations§
impl Freeze for HttpUrlComponents
impl RefUnwindSafe for HttpUrlComponents
impl Send for HttpUrlComponents
impl Sync for HttpUrlComponents
impl Unpin for HttpUrlComponents
impl UnwindSafe for HttpUrlComponents
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