pub struct Url {
pub protocol: Option<String>,
pub slashes: bool,
pub auth: Option<String>,
pub hostname: Option<String>,
pub port: Option<String>,
pub pathname: Option<String>,
pub search: Option<String>,
pub hash: Option<String>,
}Expand description
Url object is created and returned by the parse_url function.
Fields§
§protocol: Option<String>The protocol property identifies the URL’s protocol scheme.
For example: "http:".
slashes: boolThe slashes property is a boolean with a value of true if two ASCII
forward-slash characters (/) are required following the colon in the
protocol.
auth: Option<String>The auth property is the username and password portion of the URL, also
referred to as userinfo. This string subset follows the protocol and
double slashes (if present) and precedes the host component, delimited by @.
The string is either the username, or it is the username and password separated
by :.
For example: "user:pass".
hostname: Option<String>The hostname property is the host name portion of the host component
without the port included.
For example: "sub.example.com".
port: Option<String>The port property is the numeric port portion of the host component.
For example: "8080".
pathname: Option<String>The pathname property consists of the entire path section of the URL. This
is everything following the host (including the port) and before the start
of the query or hash components, delimited by either the ASCII question
mark (?) or hash (#) characters.
For example: '/p/a/t/h'.
No decoding of the path string is performed.
search: Option<String>The search property consists of the entire “query string” portion of the
URL, including the leading ASCII question mark (?) character.
For example: '?query=string'.
No decoding of the query string is performed.
hash: Option<String>The hash property is the fragment identifier portion of the URL including the
leading # character.
For example: "#hash".