Skip to main content

refining_char/
unicode.rs

1//! Unicode character predicates.
2
3use crate::internals::predicate;
4
5predicate! {
6    Name = CharAscii,
7    Method = is_ascii,
8    Doc = "Checks whether the given character is within the ASCII range.",
9    Expected = "ascii character",
10    Code = char::ascii,
11}
12
13predicate! {
14    Name = CharAlphabetic,
15    Method = is_alphabetic,
16    Doc = "Checks whether the given character is alphabetic.",
17    Expected = "alphabetic character",
18    Code = char::alphabetic,
19}
20
21predicate! {
22    Name = CharAlphanumeric,
23    Method = is_alphanumeric,
24    Doc = "Checks whether the given character is alphanumeric.",
25    Expected = "alphanumeric character",
26    Code = char::alphanumeric,
27}
28
29predicate! {
30    Name = CharControl,
31    Method = is_control,
32    Doc = "Checks whether the given character is control.",
33    Expected = "control character",
34    Code = char::control,
35}
36
37predicate! {
38    Name = CharNumeric,
39    Method = is_numeric,
40    Doc = "Checks whether the given character is numeric.",
41    Expected = "numeric character",
42    Code = char::numeric,
43}
44
45predicate! {
46    Name = CharLowercase,
47    Method = is_lowercase,
48    Doc = "Checks whether the given character is lowercase.",
49    Expected = "lowercase character",
50    Code = char::lowercase,
51}
52
53predicate! {
54    Name = CharUppercase,
55    Method = is_uppercase,
56    Doc = "Checks whether the given character is uppercase.",
57    Expected = "uppercase character",
58    Code = char::uppercase,
59}
60
61predicate! {
62    Name = CharWhitespace,
63    Method = is_whitespace,
64    Doc = "Checks whether the given character is whitespace.",
65    Expected = "whitespace character",
66    Code = char::whitespace,
67}