Enum url::SchemeType
source · pub enum SchemeType {
NonRelative,
Relative(u16),
FileLike,
}Expand description
Determines the behavior of the URL parser for a given scheme.
Variants§
NonRelative
Indicate that the scheme is non-relative.
The scheme data of the URL (everything other than the scheme, query string, and fragment identifier) is parsed as a single percent-encoded string of which no structure is assumed. That string may need to be parsed further, per a scheme-specific format.
Relative(u16)
Indicate that the scheme is relative, and what the default port number is.
The scheme data is structured as username, password, host, port number, and path. Relative URL references are supported, if a base URL was given. The string value indicates the default port number as a string of ASCII digits, or the empty string to indicate no default port number.
FileLike
Indicate a relative scheme similar to the file scheme.
For example, you might want to have distinct git+file and hg+file URL schemes.
This is like Relative except the host can be empty, there is no port number,
and path parsing has (platform-independent) quirks to support Windows filenames.
Implementations§
source§impl SchemeType
impl SchemeType
pub fn default_port(&self) -> Option<u16>
pub fn same_as(&self, other: SchemeType) -> bool
Trait Implementations§
source§impl Clone for SchemeType
impl Clone for SchemeType
source§fn clone(&self) -> SchemeType
fn clone(&self) -> SchemeType
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moresource§impl Debug for SchemeType
impl Debug for SchemeType
source§impl Hash for SchemeType
impl Hash for SchemeType
source§impl Ord for SchemeType
impl Ord for SchemeType
source§fn cmp(&self, other: &SchemeType) -> Ordering
fn cmp(&self, other: &SchemeType) -> Ordering
1.21.0 · source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
source§impl PartialEq for SchemeType
impl PartialEq for SchemeType
source§fn eq(&self, other: &SchemeType) -> bool
fn eq(&self, other: &SchemeType) -> bool
self and other values to be equal, and is used
by ==.source§impl PartialOrd for SchemeType
impl PartialOrd for SchemeType
source§fn partial_cmp(&self, other: &SchemeType) -> Option<Ordering>
fn partial_cmp(&self, other: &SchemeType) -> Option<Ordering>
1.0.0 · source§fn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
self and other) and is used by the <=
operator. Read moreimpl Copy for SchemeType
impl Eq for SchemeType
impl StructuralPartialEq for SchemeType
Auto Trait Implementations§
impl Freeze for SchemeType
impl RefUnwindSafe for SchemeType
impl Send for SchemeType
impl Sync for SchemeType
impl Unpin for SchemeType
impl UnwindSafe for SchemeType
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
source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§default unsafe fn clone_to_uninit(&self, dst: *mut T)
default unsafe fn clone_to_uninit(&self, dst: *mut T)
clone_to_uninit)source§impl<T> CloneToUninit for Twhere
T: Copy,
impl<T> CloneToUninit for Twhere
T: Copy,
source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
clone_to_uninit)