use crate::validator::rules::string as internal;
#[inline]
#[must_use]
pub fn is_email(s: &str) -> bool {
internal::is_email(s)
}
#[inline]
#[must_use]
pub fn is_hostname(s: &str) -> bool {
internal::is_hostname(s)
}
#[inline]
#[must_use]
pub fn is_ip(s: &str) -> bool {
internal::is_ip(s)
}
#[inline]
#[must_use]
pub fn is_ipv4(s: &str) -> bool {
s.parse::<std::net::Ipv4Addr>().is_ok()
}
#[inline]
#[must_use]
pub fn is_ipv6(s: &str) -> bool {
internal::is_ipv6(s)
}
#[inline]
#[must_use]
pub fn is_uri(s: &str) -> bool {
internal::is_uri(s)
}
#[inline]
#[must_use]
pub fn is_uri_ref(s: &str) -> bool {
internal::is_uri_ref(s)
}
#[inline]
#[must_use]
pub fn is_uuid(s: &str) -> bool {
internal::is_uuid(s)
}
#[inline]
#[must_use]
pub fn is_tuuid(s: &str) -> bool {
internal::is_tuuid(s)
}
#[inline]
#[must_use]
pub fn is_ulid(s: &str) -> bool {
internal::is_ulid(s)
}
#[inline]
#[must_use]
pub fn is_ip_prefix(s: &str, strict: bool) -> bool {
internal::is_ipv4_prefix(s, strict) || internal::is_ipv6_prefix(s, strict)
}
#[inline]
#[must_use]
pub fn is_ipv4_prefix(s: &str, strict: bool) -> bool {
internal::is_ipv4_prefix(s, strict)
}
#[inline]
#[must_use]
pub fn is_ipv6_prefix(s: &str, strict: bool) -> bool {
internal::is_ipv6_prefix(s, strict)
}
#[inline]
#[must_use]
pub fn is_host_and_port(s: &str, port_required: bool) -> bool {
internal::is_host_and_port(s, port_required)
}
#[inline]
#[must_use]
pub fn is_http_header_name(s: &str, strict: bool) -> bool {
if strict {
internal::is_valid_http_header_name_strict(s)
} else {
internal::is_valid_http_header_name_loose(s)
}
}
#[inline]
#[must_use]
pub fn is_http_header_value(s: &str, strict: bool) -> bool {
if strict {
internal::is_valid_http_header_value_strict(s)
} else {
internal::is_valid_http_header_value_loose(s)
}
}