better-url 0.12.0

A better URL crate.
Documentation
//! [`SchemeType`].

use crate::prelude::*;

/// The type of a scheme.
#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash)]
#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
#[cfg_attr(feature = "serde", serde(deny_unknown_fields))]
pub enum SchemeType {
    /** File.                 */ File          ,
    /** Special but not file. */ SpecialNotFile,
    /** Non-special.          */ NonSpecial    ,
}

impl SchemeType {
    /** If it's [`Self::File`] or [`Self::SpecialNotFile`]. */ pub const fn is_special         (self) -> bool {matches!(self, Self::File | Self::SpecialNotFile)}
    /** If it's [`Self::File`].                             */ pub const fn is_file            (self) -> bool {matches!(self, Self::File                       )}
    /** If it's [`Self::SpecialNotFile`].                   */ pub const fn is_special_not_file(self) -> bool {matches!(self, Self::SpecialNotFile             )}
    /** If it's [`Self::NonSpecial`].                       */ pub const fn is_non_special     (self) -> bool {matches!(self, Self::NonSpecial                 )}
}