#[non_exhaustive]pub enum UrlError {
Empty,
TooLong(usize),
MissingScheme,
InvalidScheme,
MissingSchemeSeparator,
MissingAuthority,
InvalidHost,
InvalidPort,
InvalidChar(char),
}net only.Expand description
Error type for URL validation.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Empty
Empty URL
The provided string is empty. URLs must contain at least a scheme.
TooLong(usize)
URL exceeds maximum length of 2048 characters
URLs must not exceed 2048 characters (common browser limit). This variant contains the actual length of the provided URL.
MissingScheme
Missing scheme
URLs must contain a scheme (e.g., http, https, ftp).
InvalidScheme
Invalid scheme
The scheme contains invalid characters. Schemes must start with a letter and contain only letters, digits, +, ., and -.
MissingSchemeSeparator
Missing : after scheme
The scheme must be followed by a colon (:).
MissingAuthority
Missing authority
The URL has // but no authority (host).
InvalidHost
Invalid host
The host part is invalid.
InvalidPort
Invalid port
The port part is invalid.
InvalidChar(char)
Invalid character in URL
The URL contains an invalid character. This variant contains the invalid character.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for UrlError
impl<'de> Deserialize<'de> for UrlError
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Source§impl Error for UrlError
Available on crate feature std only.
impl Error for UrlError
std only.