rust / latest / std / ascii / enum.char.html

Enum std::ascii::Char

#[repr(u8)]pub enum Char {
Show 128 variants    Null = 0,
    StartOfHeading = 1,
    StartOfText = 2,
    EndOfText = 3,
    EndOfTransmission = 4,
    Enquiry = 5,
    Acknowledge = 6,
    Bell = 7,
    Backspace = 8,
    CharacterTabulation = 9,
    LineFeed = 10,
    LineTabulation = 11,
    FormFeed = 12,
    CarriageReturn = 13,
    ShiftOut = 14,
    ShiftIn = 15,
    DataLinkEscape = 16,
    DeviceControlOne = 17,
    DeviceControlTwo = 18,
    DeviceControlThree = 19,
    DeviceControlFour = 20,
    NegativeAcknowledge = 21,
    SynchronousIdle = 22,
    EndOfTransmissionBlock = 23,
    Cancel = 24,
    EndOfMedium = 25,
    Substitute = 26,
    Escape = 27,
    InformationSeparatorFour = 28,
    InformationSeparatorThree = 29,
    InformationSeparatorTwo = 30,
    InformationSeparatorOne = 31,
    Space = 32,
    ExclamationMark = 33,
    QuotationMark = 34,
    NumberSign = 35,
    DollarSign = 36,
    PercentSign = 37,
    Ampersand = 38,
    Apostrophe = 39,
    LeftParenthesis = 40,
    RightParenthesis = 41,
    Asterisk = 42,
    PlusSign = 43,
    Comma = 44,
    HyphenMinus = 45,
    FullStop = 46,
    Solidus = 47,
    Digit0 = 48,
    Digit1 = 49,
    Digit2 = 50,
    Digit3 = 51,
    Digit4 = 52,
    Digit5 = 53,
    Digit6 = 54,
    Digit7 = 55,
    Digit8 = 56,
    Digit9 = 57,
    Colon = 58,
    Semicolon = 59,
    LessThanSign = 60,
    EqualsSign = 61,
    GreaterThanSign = 62,
    QuestionMark = 63,
    CommercialAt = 64,
    CapitalA = 65,
    CapitalB = 66,
    CapitalC = 67,
    CapitalD = 68,
    CapitalE = 69,
    CapitalF = 70,
    CapitalG = 71,
    CapitalH = 72,
    CapitalI = 73,
    CapitalJ = 74,
    CapitalK = 75,
    CapitalL = 76,
    CapitalM = 77,
    CapitalN = 78,
    CapitalO = 79,
    CapitalP = 80,
    CapitalQ = 81,
    CapitalR = 82,
    CapitalS = 83,
    CapitalT = 84,
    CapitalU = 85,
    CapitalV = 86,
    CapitalW = 87,
    CapitalX = 88,
    CapitalY = 89,
    CapitalZ = 90,
    LeftSquareBracket = 91,
    ReverseSolidus = 92,
    RightSquareBracket = 93,
    CircumflexAccent = 94,
    LowLine = 95,
    GraveAccent = 96,
    SmallA = 97,
    SmallB = 98,
    SmallC = 99,
    SmallD = 100,
    SmallE = 101,
    SmallF = 102,
    SmallG = 103,
    SmallH = 104,
    SmallI = 105,
    SmallJ = 106,
    SmallK = 107,
    SmallL = 108,
    SmallM = 109,
    SmallN = 110,
    SmallO = 111,
    SmallP = 112,
    SmallQ = 113,
    SmallR = 114,
    SmallS = 115,
    SmallT = 116,
    SmallU = 117,
    SmallV = 118,
    SmallW = 119,
    SmallX = 120,
    SmallY = 121,
    SmallZ = 122,
    LeftCurlyBracket = 123,
    VerticalLine = 124,
    RightCurlyBracket = 125,
    Tilde = 126,
    Delete = 127,
}
๐Ÿ”ฌThis is a nightly-only experimental API. (ascii_char #110998)

One of the 128 Unicode characters from U+0000 through U+007F, often known as the ASCII subset.

Officially, this is the first block in Unicode, Basic Latin. For details, see the C0 Controls and Basic Latin code chart.

This block was based on older 7-bit character code standards such as ANSI X3.4-1977, ISO 646-1973, and NIST FIPS 1-2.

When to use this

The main advantage of this subset is that itโ€™s always valid UTF-8. As such, the &[ascii::Char] -> &str conversion function (as well as other related ones) are O(1): no runtime checks are needed.

If youโ€™re consuming strings, you should usually handle Unicode and thus accept strs, not limit yourself to ascii::Chars.

However, certain formats are intentionally designed to produce ASCII-only output in order to be 8-bit-clean. In those cases, it can be simpler and faster to generate ascii::Chars instead of dealing with the variable width properties of general UTF-8 encoded strings, while still allowing the result to be used freely with other Rust things that deal in general strs.

For example, a UUID library might offer a way to produce the string representation of a UUID as an [ascii::Char; 36] to avoid memory allocation yet still allow it to be used as UTF-8 via as_str without paying for validation (or needing unsafe code) the way it would if it were provided as a [u8; 36].

Layout

This type is guaranteed to have a size and alignment of 1 byte.

Names

The variants on this type are Unicode names of the characters in upper camel case, with a few tweaks:

  • For <control> characters, the primary alias name is used.
  • LATIN is dropped, as this block has no non-latin letters.
  • LETTER is dropped, as CAPITAL/SMALL suffices in this block.
  • DIGITs use a single digit rather than writing out ZERO, ONE, etc.

Variants

Null = 0
๐Ÿ”ฌThis is a nightly-only experimental API. (ascii_char_variants #110998)

U+0000

StartOfHeading = 1
๐Ÿ”ฌThis is a nightly-only experimental API. (ascii_char_variants #110998)

U+0001

StartOfText = 2
๐Ÿ”ฌThis is a nightly-only experimental API. (ascii_char_variants #110998)

U+0002

EndOfText = 3
๐Ÿ”ฌThis is a nightly-only experimental API. (ascii_char_variants #110998)

U+0003

EndOfTransmission = 4
๐Ÿ”ฌThis is a nightly-only experimental API. (ascii_char_variants #110998)

U+0004

Enquiry = 5
๐Ÿ”ฌThis is a nightly-only experimental API. (ascii_char_variants #110998)

U+0005

Acknowledge = 6
๐Ÿ”ฌThis is a nightly-only experimental API. (ascii_char_variants #110998)

U+0006

Bell = 7
๐Ÿ”ฌThis is a nightly-only experimental API. (ascii_char_variants #110998)

U+0007

Backspace = 8
๐Ÿ”ฌThis is a nightly-only experimental API. (ascii_char_variants #110998)

U+0008

CharacterTabulation = 9
๐Ÿ”ฌThis is a nightly-only experimental API. (ascii_char_variants #110998)

U+0009

LineFeed = 10
๐Ÿ”ฌThis is a nightly-only experimental API. (ascii_char_variants #110998)

U+000A

LineTabulation = 11
๐Ÿ”ฌThis is a nightly-only experimental API. (ascii_char_variants #110998)

U+000B

FormFeed = 12
๐Ÿ”ฌThis is a nightly-only experimental API. (ascii_char_variants #110998)

U+000C

CarriageReturn = 13
๐Ÿ”ฌThis is a nightly-only experimental API. (ascii_char_variants #110998)

U+000D

ShiftOut = 14
๐Ÿ”ฌThis is a nightly-only experimental API. (ascii_char_variants #110998)

U+000E

ShiftIn = 15
๐Ÿ”ฌThis is a nightly-only experimental API. (ascii_char_variants #110998)

U+000F

DataLinkEscape = 16
๐Ÿ”ฌThis is a nightly-only experimental API. (ascii_char_variants #110998)

U+0010

DeviceControlOne = 17
๐Ÿ”ฌThis is a nightly-only experimental API. (ascii_char_variants #110998)

U+0011

DeviceControlTwo = 18
๐Ÿ”ฌThis is a nightly-only experimental API. (ascii_char_variants #110998)

U+0012

DeviceControlThree = 19
๐Ÿ”ฌThis is a nightly-only experimental API. (ascii_char_variants #110998)

U+0013

DeviceControlFour = 20
๐Ÿ”ฌThis is a nightly-only experimental API. (ascii_char_variants #110998)

U+0014

NegativeAcknowledge = 21
๐Ÿ”ฌThis is a nightly-only experimental API. (ascii_char_variants #110998)

U+0015

SynchronousIdle = 22
๐Ÿ”ฌThis is a nightly-only experimental API. (ascii_char_variants #110998)

U+0016

EndOfTransmissionBlock = 23
๐Ÿ”ฌThis is a nightly-only experimental API. (ascii_char_variants #110998)

U+0017

Cancel = 24
๐Ÿ”ฌThis is a nightly-only experimental API. (ascii_char_variants #110998)

U+0018

EndOfMedium = 25
๐Ÿ”ฌThis is a nightly-only experimental API. (ascii_char_variants #110998)

U+0019

Substitute = 26
๐Ÿ”ฌThis is a nightly-only experimental API. (ascii_char_variants #110998)

U+001A

Escape = 27
๐Ÿ”ฌThis is a nightly-only experimental API. (ascii_char_variants #110998)

U+001B

InformationSeparatorFour = 28
๐Ÿ”ฌThis is a nightly-only experimental API. (ascii_char_variants #110998)

U+001C

InformationSeparatorThree = 29
๐Ÿ”ฌThis is a nightly-only experimental API. (ascii_char_variants #110998)

U+001D

InformationSeparatorTwo = 30
๐Ÿ”ฌThis is a nightly-only experimental API. (ascii_char_variants #110998)

U+001E

InformationSeparatorOne = 31
๐Ÿ”ฌThis is a nightly-only experimental API. (ascii_char_variants #110998)

U+001F

Space = 32
๐Ÿ”ฌThis is a nightly-only experimental API. (ascii_char_variants #110998)

U+0020

ExclamationMark = 33
๐Ÿ”ฌThis is a nightly-only experimental API. (ascii_char_variants #110998)

U+0021

QuotationMark = 34
๐Ÿ”ฌThis is a nightly-only experimental API. (ascii_char_variants #110998)

U+0022

NumberSign = 35
๐Ÿ”ฌThis is a nightly-only experimental API. (ascii_char_variants #110998)

U+0023

DollarSign = 36
๐Ÿ”ฌThis is a nightly-only experimental API. (ascii_char_variants #110998)

U+0024

PercentSign = 37
๐Ÿ”ฌThis is a nightly-only experimental API. (ascii_char_variants #110998)

U+0025

Ampersand = 38
๐Ÿ”ฌThis is a nightly-only experimental API. (ascii_char_variants #110998)

U+0026

Apostrophe = 39
๐Ÿ”ฌThis is a nightly-only experimental API. (ascii_char_variants #110998)

U+0027

LeftParenthesis = 40
๐Ÿ”ฌThis is a nightly-only experimental API. (ascii_char_variants #110998)

U+0028

RightParenthesis = 41
๐Ÿ”ฌThis is a nightly-only experimental API. (ascii_char_variants #110998)

U+0029

Asterisk = 42
๐Ÿ”ฌThis is a nightly-only experimental API. (ascii_char_variants #110998)

U+002A

PlusSign = 43
๐Ÿ”ฌThis is a nightly-only experimental API. (ascii_char_variants #110998)

U+002B

Comma = 44
๐Ÿ”ฌThis is a nightly-only experimental API. (ascii_char_variants #110998)

U+002C

HyphenMinus = 45
๐Ÿ”ฌThis is a nightly-only experimental API. (ascii_char_variants #110998)

U+002D

FullStop = 46
๐Ÿ”ฌThis is a nightly-only experimental API. (ascii_char_variants #110998)

U+002E

Solidus = 47
๐Ÿ”ฌThis is a nightly-only experimental API. (ascii_char_variants #110998)

U+002F

Digit0 = 48
๐Ÿ”ฌThis is a nightly-only experimental API. (ascii_char_variants #110998)

U+0030

Digit1 = 49
๐Ÿ”ฌThis is a nightly-only experimental API. (ascii_char_variants #110998)

U+0031

Digit2 = 50
๐Ÿ”ฌThis is a nightly-only experimental API. (ascii_char_variants #110998)

U+0032

Digit3 = 51
๐Ÿ”ฌThis is a nightly-only experimental API. (ascii_char_variants #110998)

U+0033

Digit4 = 52
๐Ÿ”ฌThis is a nightly-only experimental API. (ascii_char_variants #110998)

U+0034

Digit5 = 53
๐Ÿ”ฌThis is a nightly-only experimental API. (ascii_char_variants #110998)

U+0035

Digit6 = 54
๐Ÿ”ฌThis is a nightly-only experimental API. (ascii_char_variants #110998)

U+0036

Digit7 = 55
๐Ÿ”ฌThis is a nightly-only experimental API. (ascii_char_variants #110998)

U+0037

Digit8 = 56
๐Ÿ”ฌThis is a nightly-only experimental API. (ascii_char_variants #110998)

U+0038

Digit9 = 57
๐Ÿ”ฌThis is a nightly-only experimental API. (ascii_char_variants #110998)

U+0039

Colon = 58
๐Ÿ”ฌThis is a nightly-only experimental API. (ascii_char_variants #110998)

U+003A

Semicolon = 59
๐Ÿ”ฌThis is a nightly-only experimental API. (ascii_char_variants #110998)

U+003B

LessThanSign = 60
๐Ÿ”ฌThis is a nightly-only experimental API. (ascii_char_variants #110998)

U+003C

EqualsSign = 61
๐Ÿ”ฌThis is a nightly-only experimental API. (ascii_char_variants #110998)

U+003D

GreaterThanSign = 62
๐Ÿ”ฌThis is a nightly-only experimental API. (ascii_char_variants #110998)

U+003E

QuestionMark = 63
๐Ÿ”ฌThis is a nightly-only experimental API. (ascii_char_variants #110998)

U+003F

CommercialAt = 64
๐Ÿ”ฌThis is a nightly-only experimental API. (ascii_char_variants #110998)

U+0040

CapitalA = 65
๐Ÿ”ฌThis is a nightly-only experimental API. (ascii_char_variants #110998)

U+0041

CapitalB = 66
๐Ÿ”ฌThis is a nightly-only experimental API. (ascii_char_variants #110998)

U+0042

CapitalC = 67
๐Ÿ”ฌThis is a nightly-only experimental API. (ascii_char_variants #110998)

U+0043

CapitalD = 68
๐Ÿ”ฌThis is a nightly-only experimental API. (ascii_char_variants #110998)

U+0044

CapitalE = 69
๐Ÿ”ฌThis is a nightly-only experimental API. (ascii_char_variants #110998)

U+0045

CapitalF = 70
๐Ÿ”ฌThis is a nightly-only experimental API. (ascii_char_variants #110998)

U+0046

CapitalG = 71
๐Ÿ”ฌThis is a nightly-only experimental API. (ascii_char_variants #110998)

U+0047

CapitalH = 72
๐Ÿ”ฌThis is a nightly-only experimental API. (ascii_char_variants #110998)

U+0048

CapitalI = 73
๐Ÿ”ฌThis is a nightly-only experimental API. (ascii_char_variants #110998)

U+0049

CapitalJ = 74
๐Ÿ”ฌThis is a nightly-only experimental API. (ascii_char_variants #110998)

U+004A

CapitalK = 75
๐Ÿ”ฌThis is a nightly-only experimental API. (ascii_char_variants #110998)

U+004B

CapitalL = 76
๐Ÿ”ฌThis is a nightly-only experimental API. (ascii_char_variants #110998)

U+004C

CapitalM = 77
๐Ÿ”ฌThis is a nightly-only experimental API. (ascii_char_variants #110998)

U+004D

CapitalN = 78
๐Ÿ”ฌThis is a nightly-only experimental API. (ascii_char_variants #110998)

U+004E

CapitalO = 79
๐Ÿ”ฌThis is a nightly-only experimental API. (ascii_char_variants #110998)

U+004F

CapitalP = 80
๐Ÿ”ฌThis is a nightly-only experimental API. (ascii_char_variants #110998)

U+0050

CapitalQ = 81
๐Ÿ”ฌThis is a nightly-only experimental API. (ascii_char_variants #110998)

U+0051

CapitalR = 82
๐Ÿ”ฌThis is a nightly-only experimental API. (ascii_char_variants #110998)

U+0052

CapitalS = 83
๐Ÿ”ฌThis is a nightly-only experimental API. (ascii_char_variants #110998)

U+0053

CapitalT = 84
๐Ÿ”ฌThis is a nightly-only experimental API. (ascii_char_variants #110998)

U+0054

CapitalU = 85
๐Ÿ”ฌThis is a nightly-only experimental API. (ascii_char_variants #110998)

U+0055

CapitalV = 86
๐Ÿ”ฌThis is a nightly-only experimental API. (ascii_char_variants #110998)

U+0056

CapitalW = 87
๐Ÿ”ฌThis is a nightly-only experimental API. (ascii_char_variants #110998)

U+0057

CapitalX = 88
๐Ÿ”ฌThis is a nightly-only experimental API. (ascii_char_variants #110998)

U+0058

CapitalY = 89
๐Ÿ”ฌThis is a nightly-only experimental API. (ascii_char_variants #110998)

U+0059

CapitalZ = 90
๐Ÿ”ฌThis is a nightly-only experimental API. (ascii_char_variants #110998)

U+005A

LeftSquareBracket = 91
๐Ÿ”ฌThis is a nightly-only experimental API. (ascii_char_variants #110998)

U+005B

ReverseSolidus = 92
๐Ÿ”ฌThis is a nightly-only experimental API. (ascii_char_variants #110998)

U+005C

RightSquareBracket = 93
๐Ÿ”ฌThis is a nightly-only experimental API. (ascii_char_variants #110998)

U+005D

CircumflexAccent = 94
๐Ÿ”ฌThis is a nightly-only experimental API. (ascii_char_variants #110998)

U+005E

LowLine = 95
๐Ÿ”ฌThis is a nightly-only experimental API. (ascii_char_variants #110998)

U+005F

GraveAccent = 96
๐Ÿ”ฌThis is a nightly-only experimental API. (ascii_char_variants #110998)

U+0060

SmallA = 97
๐Ÿ”ฌThis is a nightly-only experimental API. (ascii_char_variants #110998)

U+0061

SmallB = 98
๐Ÿ”ฌThis is a nightly-only experimental API. (ascii_char_variants #110998)

U+0062

SmallC = 99
๐Ÿ”ฌThis is a nightly-only experimental API. (ascii_char_variants #110998)

U+0063

SmallD = 100
๐Ÿ”ฌThis is a nightly-only experimental API. (ascii_char_variants #110998)

U+0064

SmallE = 101
๐Ÿ”ฌThis is a nightly-only experimental API. (ascii_char_variants #110998)

U+0065

SmallF = 102
๐Ÿ”ฌThis is a nightly-only experimental API. (ascii_char_variants #110998)

U+0066

SmallG = 103
๐Ÿ”ฌThis is a nightly-only experimental API. (ascii_char_variants #110998)

U+0067

SmallH = 104
๐Ÿ”ฌThis is a nightly-only experimental API. (ascii_char_variants #110998)

U+0068

SmallI = 105
๐Ÿ”ฌThis is a nightly-only experimental API. (ascii_char_variants #110998)

U+0069

SmallJ = 106
๐Ÿ”ฌThis is a nightly-only experimental API. (ascii_char_variants #110998)

U+006A

SmallK = 107
๐Ÿ”ฌThis is a nightly-only experimental API. (ascii_char_variants #110998)

U+006B

SmallL = 108
๐Ÿ”ฌThis is a nightly-only experimental API. (ascii_char_variants #110998)

U+006C

SmallM = 109
๐Ÿ”ฌThis is a nightly-only experimental API. (ascii_char_variants #110998)

U+006D

SmallN = 110
๐Ÿ”ฌThis is a nightly-only experimental API. (ascii_char_variants #110998)

U+006E

SmallO = 111
๐Ÿ”ฌThis is a nightly-only experimental API. (ascii_char_variants #110998)

U+006F

SmallP = 112
๐Ÿ”ฌThis is a nightly-only experimental API. (ascii_char_variants #110998)

U+0070

SmallQ = 113
๐Ÿ”ฌThis is a nightly-only experimental API. (ascii_char_variants #110998)

U+0071

SmallR = 114
๐Ÿ”ฌThis is a nightly-only experimental API. (ascii_char_variants #110998)

U+0072

SmallS = 115
๐Ÿ”ฌThis is a nightly-only experimental API. (ascii_char_variants #110998)

U+0073

SmallT = 116
๐Ÿ”ฌThis is a nightly-only experimental API. (ascii_char_variants #110998)

U+0074

SmallU = 117
๐Ÿ”ฌThis is a nightly-only experimental API. (ascii_char_variants #110998)

U+0075

SmallV = 118
๐Ÿ”ฌThis is a nightly-only experimental API. (ascii_char_variants #110998)

U+0076

SmallW = 119
๐Ÿ”ฌThis is a nightly-only experimental API. (ascii_char_variants #110998)

U+0077

SmallX = 120
๐Ÿ”ฌThis is a nightly-only experimental API. (ascii_char_variants #110998)

U+0078

SmallY = 121
๐Ÿ”ฌThis is a nightly-only experimental API. (ascii_char_variants #110998)

U+0079

SmallZ = 122
๐Ÿ”ฌThis is a nightly-only experimental API. (ascii_char_variants #110998)

U+007A

LeftCurlyBracket = 123
๐Ÿ”ฌThis is a nightly-only experimental API. (ascii_char_variants #110998)

U+007B

VerticalLine = 124
๐Ÿ”ฌThis is a nightly-only experimental API. (ascii_char_variants #110998)

U+007C

RightCurlyBracket = 125
๐Ÿ”ฌThis is a nightly-only experimental API. (ascii_char_variants #110998)

U+007D

Tilde = 126
๐Ÿ”ฌThis is a nightly-only experimental API. (ascii_char_variants #110998)

U+007E

Delete = 127
๐Ÿ”ฌThis is a nightly-only experimental API. (ascii_char_variants #110998)

U+007F

Implementations

source
impl AsciiChar
source
pub const fn from_u8(b: u8) -> Option<AsciiChar>
๐Ÿ”ฌThis is a nightly-only experimental API. (ascii_char #110998)

Creates an ascii character from the byte b, or returns None if itโ€™s too large.

source
pub const unsafe fn from_u8_unchecked(b: u8) -> AsciiChar
๐Ÿ”ฌThis is a nightly-only experimental API. (ascii_char #110998)

Creates an ASCII character from the byte b, without checking whether itโ€™s valid.

Safety

b must be in 0..=127, or else this is UB.

source
pub const fn digit(d: u8) -> Option<AsciiChar>
๐Ÿ”ฌThis is a nightly-only experimental API. (ascii_char #110998)

When passed the number 0, 1, โ€ฆ, 9, returns the character '0', '1', โ€ฆ, '9' respectively.

If d >= 10, returns None.

source
pub const unsafe fn digit_unchecked(d: u8) -> AsciiChar
๐Ÿ”ฌThis is a nightly-only experimental API. (ascii_char #110998)

When passed the number 0, 1, โ€ฆ, 9, returns the character '0', '1', โ€ฆ, '9' respectively, without checking that itโ€™s in-range.

Safety

This is immediate UB if called with d > 64.

If d >= 10 and d <= 64, this is allowed to return any value or panic. Notably, it should not be expected to return hex digits, or any other reasonable extension of the decimal digits.

(This lose safety condition is intended to simplify soundness proofs when writing code using this method, since the implementation doesnโ€™t need something really specific, not to make those other arguments do something useful. It might be tightened before stabilization.)

source
pub const fn to_u8(self) -> u8
๐Ÿ”ฌThis is a nightly-only experimental API. (ascii_char #110998)

Gets this ASCII character as a byte.

source
pub const fn to_char(self) -> char
๐Ÿ”ฌThis is a nightly-only experimental API. (ascii_char #110998)

Gets this ASCII character as a char Unicode Scalar Value.

source
pub const fn as_str(&self) -> &str
๐Ÿ”ฌThis is a nightly-only experimental API. (ascii_char #110998)

Views this ASCII character as a one-code-unit UTF-8 str.

Trait Implementations

source
impl Clone for AsciiChar
source
fn clone(&self) -> AsciiChar
Returns a copy of the value. Read more
1.0.0source
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source. Read more
source
impl Debug for AsciiChar
source
fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>
Formats the value using the given formatter. Read more
source
impl Display for AsciiChar
source
fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>
Formats the value using the given formatter. Read more
source
impl Hash for AsciiChar
source
fn hash<__H>(&self, state: &mut __H)
where
    __H: Hasher,
Feeds this value into the given Hasher. Read more
1.3.0source
fn hash_slice<H>(data: &[Self], state: &mut H)
where
    H: Hasher,
    Self: Sized,
Feeds a slice of this type into the given Hasher. Read more
source
impl Ord for AsciiChar
source
fn cmp(&self, other: &AsciiChar) -> Ordering
This method returns an Ordering between self and other. Read more
1.21.0source
fn max(self, other: Self) -> Self
where
    Self: Sized,
Compares and returns the maximum of two values. Read more
1.21.0source
fn min(self, other: Self) -> Self
where
    Self: Sized,
Compares and returns the minimum of two values. Read more
1.50.0source
fn clamp(self, min: Self, max: Self) -> Self
where
    Self: Sized + PartialOrd,
Restrict a value to a certain interval. Read more
source
impl PartialEq for AsciiChar
source
fn eq(&self, other: &AsciiChar) -> bool
This method tests for self and other values to be equal, and is used by ==.
1.0.0source
fn ne(&self, other: &Rhs) -> bool
This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
source
impl PartialOrd for AsciiChar
source
fn partial_cmp(&self, other: &AsciiChar) -> Option<Ordering>
This method returns an ordering between self and other values if one exists. Read more
1.0.0source
fn lt(&self, other: &Rhs) -> bool
This method tests less than (for self and other) and is used by the < operator. Read more
1.0.0source
fn le(&self, other: &Rhs) -> bool
This method tests less than or equal to (for self and other) and is used by the <= operator. Read more
1.0.0source
fn gt(&self, other: &Rhs) -> bool
This method tests greater than (for self and other) and is used by the > operator. Read more
1.0.0source
fn ge(&self, other: &Rhs) -> bool
This method tests greater than or equal to (for self and other) and is used by the >= operator. Read more
source
impl Step for AsciiChar
source
fn steps_between(_: &AsciiChar, _: &AsciiChar) -> Option<usize>
๐Ÿ”ฌThis is a nightly-only experimental API. (step_trait #42168)
Returns the number of successor steps required to get from start to end. Read more
source
fn forward_checked(start: AsciiChar, count: usize) -> Option<AsciiChar>
๐Ÿ”ฌThis is a nightly-only experimental API. (step_trait #42168)
Returns the value that would be obtained by taking the successor of self count times. Read more
source
fn backward_checked(start: AsciiChar, count: usize) -> Option<AsciiChar>
๐Ÿ”ฌThis is a nightly-only experimental API. (step_trait #42168)
Returns the value that would be obtained by taking the predecessor of self count times. Read more
source
unsafe fn forward_unchecked(start: AsciiChar, count: usize) -> AsciiChar
๐Ÿ”ฌThis is a nightly-only experimental API. (step_trait #42168)
Returns the value that would be obtained by taking the successor of self count times. Read more
source
unsafe fn backward_unchecked(start: AsciiChar, count: usize) -> AsciiChar
๐Ÿ”ฌThis is a nightly-only experimental API. (step_trait #42168)
Returns the value that would be obtained by taking the predecessor of self count times. Read more
source
fn forward(start: Self, count: usize) -> Self
๐Ÿ”ฌThis is a nightly-only experimental API. (step_trait #42168)
Returns the value that would be obtained by taking the successor of self count times. Read more
source
fn backward(start: Self, count: usize) -> Self
๐Ÿ”ฌThis is a nightly-only experimental API. (step_trait #42168)
Returns the value that would be obtained by taking the predecessor of self count times. Read more
source
impl Copy for AsciiChar
source
impl Eq for AsciiChar
source
impl StructuralEq for AsciiChar
source
impl StructuralPartialEq for AsciiChar
source
impl TrustedStep for AsciiChar

Auto Trait Implementations

impl RefUnwindSafe for AsciiChar
impl Send for AsciiChar
impl Sync for AsciiChar
impl Unpin for AsciiChar
impl UnwindSafe for AsciiChar

Blanket Implementations

source
impl<T> Any for T
where
    T: 'static + ?Sized,
source
fn type_id(&self) -> TypeId
Gets the TypeId of self. Read more
source
impl<T> Borrow<T> for T
where
    T: ?Sized,
source
fn borrow(&self) -> &T
Immutably borrows from an owned value. Read more
source
impl<T> BorrowMut<T> for T
where
    T: ?Sized,
source
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
source
impl<T> From<T> for T
source
fn from(t: T) -> T

Returns the argument unchanged.

source
impl<T, U> Into<U> for T
where
    U: From<T>,
source
fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source
impl<T> ToOwned for T
where
    T: Clone,
type Owned = T
The resulting type after obtaining ownership.
source
fn to_owned(&self) -> T
Creates owned data from borrowed data, usually by cloning. Read more
source
fn clone_into(&self, target: &mut T)
Uses borrowed data to replace owned data, usually by cloning. Read more
source
impl<T> ToString for T
where
    T: Display + ?Sized,
source
default fn to_string(&self) -> String
Converts the given value to a String. Read more
source
impl<T, U> TryFrom<U> for T
where
    U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
source
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
Performs the conversion.
source
impl<T, U> TryInto<U> for T
where
    U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
source
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
Performs the conversion.

ยฉ 2010 The Rust Project Developers
Licensed under the Apache License, Version 2.0 or the MIT license, at your option.
https://doc.rust-lang.org/std/ascii/enum.Char.html