1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
// devela::text::unicode::scalar::namespace
//
//! Defines the [`Char`] namespace.
//
// TOC
// - struct Char
// - methods over u16
// Char<char>
// Char<u16>
// Char<u32>
// Char<u8>
// Char<&[u8] | &[u8; N]>
/// Unicode scalars-related low-level *const* operations.
///
/// # Terminology
/// - A **code point** is an integer in `U+0000..=U+10FFFF`.
/// - A **surrogate** is a code point in `U+D800..=U+DFFF`.
/// - A **Unicode scalar value** is a code point that is not a surrogate.
/// Rust's [`char`][prim@char] represents exactly this set.
/// - A **scalar rank** is the zero-based position of a scalar value in the
/// ordered set of all Unicode scalar values, with the surrogate range omitted.
///
/// # Methods
/// - [over `char`](#methods-over-char)
/// - [len_utf8](#method.len_utf8).
/// - [width](#method.width) ([*common*](#method.width_common)).
/// - [is_combining](#method.is_combining) ([*common*](#method.is_combining_common)).
/// - [is_control](#method.is_control) ([*common*](#method.is_control_common)).
/// - [is_fullwidth](#method.is_fullwidth) ([*common*](#method.is_fullwidth_common)).
/// - [to_utf8_bytes](#method.to_utf8_bytes).
/// - [as_ascii](#method.as_ascii) ([*unchecked*](#method.as_ascii_unchecked)).
/// - [to_ascii_fold](#method.to_ascii_fold)
/// ([*unchecked*](#method.to_ascii_fold_unchecked)).
/// - [write_utf8_to](#method.write_utf8_to).
///
/// - [over `u16`](#methods-over-u16)
/// - [is_surrogate](#method.is_surrogate)
/// ([*high*](#method.is_surrogate_high), [*low*](#method.is_surrogate_low)).
/// - [decode_surrogate_pair](#method.decode_surrogate_pair).
///
/// - [over `u32`](#methods-over-u32)
/// - [len_bytes](#method.len_bytes).
/// - [len_utf8](#method.len_utf8-1) ([*unchecked*](#method.len_utf8_unchecked)).
/// - [width](#method.width-1) ([*common*](#method.width_common-1)).
/// - [is_valid_code](#method.is_valid_code).
/// - [is_valid_scalar](#method.is_valid_scalar).
/// - [is_noncharacter](#method.is_noncharacter).
/// - [is_combining](#method.is_combining-1) ([*common*](#method.is_combining_common-1)).
/// - [is_control](#method.is_control-1) ([*common*](#method.is_control_common-1)).
/// - [is_fullwidth](#method.is_fullwidth-1) ([*common*](#method.is_fullwidth_common-1)).
/// - [is_surrogate](#method.is_surrogate-1)
/// ([*high*](#method.is_surrogate_high-1), [*low*](#method.is_surrogate_low-1)).
/// - [as_ascii](#method.as_ascii-1) ([*unchecked*](#method.as_ascii_unchecked-1)).
/// - [to_utf8_bytes](#method.to_utf8_bytes-1)
/// ([*unchecked*](#method.to_utf8_bytes_unchecked)).
/// - [write_utf8_to_unchecked](#method.write_utf8_to_unchecked).
///
/// - [over `u8`](#methods-over-u8)
/// - [len_utf8](#method.len_utf8-2) ([*unchecked*](#method.len_utf8_unchecked-1)).
/// - [len_utf8_match](#method.len_utf8_match) ([*naive*](#method.len_utf8_match_naive)).
/// - [is_utf8_boundary](#method.is_utf8_boundary).
/// - [is_utf8_continuation](#method.is_utf8_continuation).
/// - [as_char](#method.as_char).
///
/// - [over `&[u8]`](#methods-over-u8-slice)
/// - [to_char](#method.to_char) ([*lenient*](#method.to_char_lenient),
/// [*unchecked*](#method.to_char_unchecked)<sup title="unsafe method">⚠</sup>).
/// - [to_scalar](#method.to_scalar) ([*unchecked*](#method.to_scalar_unchecked)).
/// - [has_overlong_encoding](#method.has_overlong_encoding).
/// - [has_valid_continuation](#method.has_valid_continuation).
/// - [ceil_utf8_boundary](#method.is_utf8_boundary).
/// - [floor_utf8_boundary](#method.is_utf8_boundary).
/// - [is_utf8_boundary](#method.is_utf8_boundary-1).
///
/// See also [`Str`][crate::Str].
;