pub struct OptionsBuilder { /* private fields */ }
Expand description
Builder for Options
.
Implementations§
Source§impl OptionsBuilder
impl OptionsBuilder
Sourcepub fn default_protocol<VALUE: Into<String>>(
&mut self,
value: VALUE,
) -> &mut Self
pub fn default_protocol<VALUE: Into<String>>( &mut self, value: VALUE, ) -> &mut Self
Default protocol.
Default value: http
.
Sourcepub fn normalize_protocol<VALUE: Into<bool>>(
&mut self,
value: VALUE,
) -> &mut Self
pub fn normalize_protocol<VALUE: Into<bool>>( &mut self, value: VALUE, ) -> &mut Self
Prepend defaultProtocol
to the URL if it’s protocol-relative.
Default value: true
.
Sourcepub fn force_http<VALUE: Into<bool>>(&mut self, value: VALUE) -> &mut Self
pub fn force_http<VALUE: Into<bool>>(&mut self, value: VALUE) -> &mut Self
Normalize HTTPS to HTTP.
Default value: false
.
Sourcepub fn force_https<VALUE: Into<bool>>(&mut self, value: VALUE) -> &mut Self
pub fn force_https<VALUE: Into<bool>>(&mut self, value: VALUE) -> &mut Self
Normalize HTTP to HTTPS.
This option cannot be used with the force_http
option at the same time.
Default value: false
.
Sourcepub fn strip_authentication<VALUE: Into<bool>>(
&mut self,
value: VALUE,
) -> &mut Self
pub fn strip_authentication<VALUE: Into<bool>>( &mut self, value: VALUE, ) -> &mut Self
Strip the authentication part of the URL.
Default value: true
.
Sourcepub fn strip_hash<VALUE: Into<bool>>(&mut self, value: VALUE) -> &mut Self
pub fn strip_hash<VALUE: Into<bool>>(&mut self, value: VALUE) -> &mut Self
Strip the hash part of the URL.
Default value: false
.
Sourcepub fn strip_protocol<VALUE: Into<bool>>(&mut self, value: VALUE) -> &mut Self
pub fn strip_protocol<VALUE: Into<bool>>(&mut self, value: VALUE) -> &mut Self
Remove the protocol from the URL: http://sindresorhus.com
→ sindresorhus.com
.
It will only remove https://
and http://
protocols.
Default value: false
.
Sourcepub fn strip_text_fragment<VALUE: Into<bool>>(
&mut self,
value: VALUE,
) -> &mut Self
pub fn strip_text_fragment<VALUE: Into<bool>>( &mut self, value: VALUE, ) -> &mut Self
Strip the text fragment part of the URL.
Note: The text fragment will always be removed if the strip_hash
option is set to true, as the hash contains the text fragment.
Default value: true
.
Sourcepub fn strip_www<VALUE: Into<bool>>(&mut self, value: VALUE) -> &mut Self
pub fn strip_www<VALUE: Into<bool>>(&mut self, value: VALUE) -> &mut Self
Remove www. from the URL.
Default value: true
.
Sourcepub fn remove_query_parameters<VALUE: Into<RemoveQueryParametersOptions>>(
&mut self,
value: VALUE,
) -> &mut Self
pub fn remove_query_parameters<VALUE: Into<RemoveQueryParametersOptions>>( &mut self, value: VALUE, ) -> &mut Self
Remove query parameters that matches any of the provided strings or regexes.
Default value: ^utm_\w+
.
Sourcepub fn keep_query_parameters<VALUE: Into<Option<Vec<Regex>>>>(
&mut self,
value: VALUE,
) -> &mut Self
pub fn keep_query_parameters<VALUE: Into<Option<Vec<Regex>>>>( &mut self, value: VALUE, ) -> &mut Self
Keeps only query parameters that matches any of the provided strings or regexes.
Note: It overrides the remove_query_parameters
option.
Default value: None
.
Sourcepub fn remove_trailing_slash<VALUE: Into<bool>>(
&mut self,
value: VALUE,
) -> &mut Self
pub fn remove_trailing_slash<VALUE: Into<bool>>( &mut self, value: VALUE, ) -> &mut Self
Remove trailing slash.
Note: Trailing slash is always removed if the URL doesn’t have a pathname unless the remove_single_slash
option is set to false.
Default value: true
.
Sourcepub fn remove_single_slash<VALUE: Into<bool>>(
&mut self,
value: VALUE,
) -> &mut Self
pub fn remove_single_slash<VALUE: Into<bool>>( &mut self, value: VALUE, ) -> &mut Self
Remove a sole /
pathname in the output. This option is independent of remove_trailing_slash
.
Default value: true
.
Sourcepub fn remove_directory_index<VALUE: Into<RemoveDirectoryIndexOptions>>(
&mut self,
value: VALUE,
) -> &mut Self
pub fn remove_directory_index<VALUE: Into<RemoveDirectoryIndexOptions>>( &mut self, value: VALUE, ) -> &mut Self
Removes the default directory index file from path that matches any of the provided strings or regexes. When true
, the regex ^index\.[a-z]+$
is used.
Default value: None
.
Sourcepub fn remove_explicit_port<VALUE: Into<bool>>(
&mut self,
value: VALUE,
) -> &mut Self
pub fn remove_explicit_port<VALUE: Into<bool>>( &mut self, value: VALUE, ) -> &mut Self
Removes an explicit port number from the URL.
Port 443 is always removed from HTTPS URLs and 80 is always removed from HTTP URLs regardless of this option.
Default value: false
.
Sourcepub fn sort_query_parameters<VALUE: Into<bool>>(
&mut self,
value: VALUE,
) -> &mut Self
pub fn sort_query_parameters<VALUE: Into<bool>>( &mut self, value: VALUE, ) -> &mut Self
Sorts the query parameters alphabetically by key.
Default value: true
.
Trait Implementations§
Source§impl Clone for OptionsBuilder
impl Clone for OptionsBuilder
Source§fn clone(&self) -> OptionsBuilder
fn clone(&self) -> OptionsBuilder
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read more