pub struct HttpUrlComponents { /* private fields */ }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.
The fields are crate-internal (§17.18): a consumer reaches them through
the generated get_* accessors. Mutators stay pub(super) — nothing
outside this crate builds the value.
Implementations§
Source§impl HttpUrlComponents
impl HttpUrlComponents
Sourcepub fn parse<U>(url: U) -> Result<HttpUrlComponents, HttpUrlError>
pub fn parse<U>(url: U) -> Result<HttpUrlComponents, HttpUrlError>
Source§impl HttpUrlComponents
impl HttpUrlComponents
pub fn get_protocol(&self) -> &String
pub fn get_mut_protocol(&mut self) -> &mut String
pub fn set_protocol(&mut self, val: String) -> &mut HttpUrlComponents
pub fn get_host(&self) -> Option<String>
pub fn try_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 HttpUrlComponents
pub fn get_port(&self) -> Option<u16>
pub fn try_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 HttpUrlComponents
pub fn get_path(&self) -> Option<String>
pub fn try_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 HttpUrlComponents
pub fn get_query(&self) -> Option<String>
pub fn try_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 HttpUrlComponents
pub fn get_fragment(&self) -> Option<String>
pub fn try_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 HttpUrlComponents
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 (const: unstable) · 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
impl Eq for HttpUrlComponents
Source§impl PartialEq for HttpUrlComponents
impl PartialEq for HttpUrlComponents
impl StructuralPartialEq for HttpUrlComponents
Auto Trait Implementations§
impl Forget for HttpUrlComponents
impl Freeze for HttpUrlComponents
impl Move for HttpUrlComponents
impl RefUnwindSafe for HttpUrlComponents
impl Send for HttpUrlComponents
impl Sync for HttpUrlComponents
impl Unpin for HttpUrlComponents
impl UnsafeUnpin for HttpUrlComponents
impl UnwindSafe for HttpUrlComponents
Blanket Implementations§
impl<T> AnySend for T
impl<T> AnySendClone for T
impl<T> AnySendSync for T
impl<T> AnySendSyncClone for T
impl<T> AnySync for T
impl<T> AnySyncClone for T
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.