ascii

Enum AsciiChar

Source
#[repr(u8)]
pub enum AsciiChar {
Show 128 variants Null = 0, SOH = 1, SOX = 2, ETX = 3, EOT = 4, ENQ = 5, ACK = 6, Bell = 7, BackSpace = 8, Tab = 9, LineFeed = 10, VT = 11, FF = 12, CarriageReturn = 13, SI = 14, SO = 15, DLE = 16, DC1 = 17, DC2 = 18, DC3 = 19, DC4 = 20, NAK = 21, SYN = 22, ETB = 23, CAN = 24, EM = 25, SUB = 26, ESC = 27, FS = 28, GS = 29, RS = 30, US = 31, Space = 32, Exclamation = 33, Quotation = 34, Hash = 35, Dollar = 36, Percent = 37, Ampersand = 38, Apostrophe = 39, ParenOpen = 40, ParenClose = 41, Asterisk = 42, Plus = 43, Comma = 44, Minus = 45, Dot = 46, Slash = 47, _0 = 48, _1 = 49, _2 = 50, _3 = 51, _4 = 52, _5 = 53, _6 = 54, _7 = 55, _8 = 56, _9 = 57, Colon = 58, Semicolon = 59, LessThan = 60, Equal = 61, GreaterThan = 62, Question = 63, At = 64, A = 65, B = 66, C = 67, D = 68, E = 69, F = 70, G = 71, H = 72, I = 73, J = 74, K = 75, L = 76, M = 77, N = 78, O = 79, P = 80, Q = 81, R = 82, S = 83, T = 84, U = 85, V = 86, W = 87, X = 88, Y = 89, Z = 90, BracketOpen = 91, BackSlash = 92, BracketClose = 93, Caret = 94, UnderScore = 95, Grave = 96, a = 97, b = 98, c = 99, d = 100, e = 101, f = 102, g = 103, h = 104, i = 105, j = 106, k = 107, l = 108, m = 109, n = 110, o = 111, p = 112, q = 113, r = 114, s = 115, t = 116, u = 117, v = 118, w = 119, x = 120, y = 121, z = 122, CurlyBraceOpen = 123, VerticalBar = 124, CurlyBraceClose = 125, Tilde = 126, DEL = 127,
}
Expand description

An ASCII character. It wraps a u8, with the highest bit always zero.

Variants§

§

Null = 0

'\0'

§

SOH = 1

§

SOX = 2

§

ETX = 3

§

EOT = 4

§

ENQ = 5

§

ACK = 6

§

Bell = 7

bell / alarm / audible

'\a' is not recognized by Rust.

§

BackSpace = 8

Backspace

'\b' is not recognized by Rust.

§

Tab = 9

'\t'

§

LineFeed = 10

'\n'

§

VT = 11

Vertical tab

'\v' is not recognized by Rust.

§

FF = 12

Form Feed

'\f' is not recognized by Rust.

§

CarriageReturn = 13

'\r'

§

SI = 14

§

SO = 15

§

DLE = 16

§

DC1 = 17

§

DC2 = 18

Device control 2

§

DC3 = 19

Device control 3, Often XOFF

§

DC4 = 20

Device control 4

§

NAK = 21

§

SYN = 22

§

ETB = 23

§

CAN = 24

§

EM = 25

§

SUB = 26

§

ESC = 27

Escape

'\e' is not recognized by Rust.

§

FS = 28

§

GS = 29

§

RS = 30

§

US = 31

§

Space = 32

' '

§

Exclamation = 33

'!'

§

Quotation = 34

'"'

§

Hash = 35

'#'

§

Dollar = 36

'$'

§

Percent = 37

'%'

§

Ampersand = 38

'&'

§

Apostrophe = 39

'\''

§

ParenOpen = 40

'('

§

ParenClose = 41

')'

§

Asterisk = 42

'*'

§

Plus = 43

'+'

§

Comma = 44

','

§

Minus = 45

'-'

§

Dot = 46

'.'

§

Slash = 47

'/'

§

_0 = 48

'0'

§

_1 = 49

'1'

§

_2 = 50

'2'

§

_3 = 51

'3'

§

_4 = 52

'4'

§

_5 = 53

'5'

§

_6 = 54

'6'

§

_7 = 55

'7'

§

_8 = 56

'8'

§

_9 = 57

'9'

§

Colon = 58

':'

§

Semicolon = 59

';'

§

LessThan = 60

'<'

§

Equal = 61

'='

§

GreaterThan = 62

'>'

§

Question = 63

'?'

§

At = 64

'@'

§

A = 65

'A'

§

B = 66

'B'

§

C = 67

'C'

§

D = 68

'D'

§

E = 69

'E'

§

F = 70

'F'

§

G = 71

'G'

§

H = 72

'H'

§

I = 73

'I'

§

J = 74

'J'

§

K = 75

'K'

§

L = 76

'L'

§

M = 77

'M'

§

N = 78

'N'

§

O = 79

'O'

§

P = 80

'P'

§

Q = 81

'Q'

§

R = 82

'R'

§

S = 83

'S'

§

T = 84

'T'

§

U = 85

'U'

§

V = 86

'V'

§

W = 87

'W'

§

X = 88

'X'

§

Y = 89

'Y'

§

Z = 90

'Z'

§

BracketOpen = 91

'['

§

BackSlash = 92

'\'

§

BracketClose = 93

']'

§

Caret = 94

'^'

§

UnderScore = 95

'_'

§

Grave = 96

'’`

§

a = 97

'a'

§

b = 98

'b'

§

c = 99

'c'

§

d = 100

'd'

§

e = 101

'e'

§

f = 102

'f'

§

g = 103

'g'

§

h = 104

'h'

§

i = 105

'i'

§

j = 106

'j'

§

k = 107

'k'

§

l = 108

'l'

§

m = 109

'm'

§

n = 110

'n'

§

o = 111

'o'

§

p = 112

'p'

§

q = 113

'q'

§

r = 114

'r'

§

s = 115

's'

§

t = 116

't'

§

u = 117

'u'

§

v = 118

'v'

§

w = 119

'w'

§

x = 120

'x'

§

y = 121

'y'

§

z = 122

'z'

§

CurlyBraceOpen = 123

'{'

§

VerticalBar = 124

'|'

§

CurlyBraceClose = 125

'}'

§

Tilde = 126

'~'

§

DEL = 127

Implementations§

Source§

impl AsciiChar

Source

pub fn from_ascii<C: ToAsciiChar>(ch: C) -> Result<Self, ToAsciiCharError>

Constructs an ASCII character from a u8, char or other character type.

§Errors

Returns Err(()) if the character can’t be ASCII encoded.

§Example
let a = AsciiChar::from_ascii('g').unwrap();
assert_eq!(a.as_char(), 'g');
Source

pub const fn new(ch: char) -> AsciiChar

Create an AsciiChar from a char, panicking if it’s not ASCII.

This function is intended for creating AsciiChar values from hardcoded known-good character literals such as 'K', '-' or '\0', and for use in const contexts. Use from_ascii() instead when you’re not certain the character is ASCII.

§Examples
assert_eq!(AsciiChar::new('@'), AsciiChar::At);
assert_eq!(AsciiChar::new('C').as_char(), 'C');

In a constant:

const SPLIT_ON: AsciiChar = AsciiChar::new(',');

This will not compile:

const BAD: AsciiChar = AsciiChar::new('Ø');
§Panics

This function will panic if passed a non-ASCII character.

The panic message might not be the most descriptive due to the current limitations of const fn.

Source

pub unsafe fn from_ascii_unchecked(ch: u8) -> Self

Constructs an ASCII character from a u8, char or other character type without any checks.

§Safety

This function is very unsafe as it can create invalid enum discriminants, which instantly creates undefined behavior. (let _ = AsciiChar::from_ascii_unchecked(200); alone is UB).

The undefined behavior is not just theoretical either: For example, [0; 128][AsciiChar::from_ascii_unchecked(255) as u8 as usize] = 0 might not panic, creating a buffer overflow, and Some(AsciiChar::from_ascii_unchecked(128)) might be None.

Source

pub const fn as_byte(self) -> u8

Converts an ASCII character into a u8.

Source

pub const fn as_char(self) -> char

Converts an ASCII character into a char.

Source

pub const fn is_alphabetic(self) -> bool

Check if the character is a letter (a-z, A-Z)

Source

pub const fn is_ascii_alphabetic(&self) -> bool

Check if the character is a letter (a-z, A-Z).

This method is identical to is_alphabetic()

Source

pub fn is_digit(self, radix: u32) -> bool

Check if the character is a digit in the given radix.

If the radix is always 10 or 16, is_ascii_digit() and is_ascii_hexdigit() will be faster.

§Panics

Radixes greater than 36 are not supported and will result in a panic.

Source

pub const fn is_ascii_digit(&self) -> bool

Check if the character is a number (0-9)

§Examples
assert_eq!(AsciiChar::new('0').is_ascii_digit(), true);
assert_eq!(AsciiChar::new('9').is_ascii_digit(), true);
assert_eq!(AsciiChar::new('a').is_ascii_digit(), false);
assert_eq!(AsciiChar::new('A').is_ascii_digit(), false);
assert_eq!(AsciiChar::new('/').is_ascii_digit(), false);
Source

pub const fn is_alphanumeric(self) -> bool

Check if the character is a letter or number

Source

pub const fn is_ascii_alphanumeric(&self) -> bool

Check if the character is a letter or number

This method is identical to is_alphanumeric()

Source

pub const fn is_ascii_blank(&self) -> bool

Check if the character is a space or horizontal tab

§Examples
assert!(AsciiChar::Space.is_ascii_blank());
assert!(AsciiChar::Tab.is_ascii_blank());
assert!(!AsciiChar::VT.is_ascii_blank());
assert!(!AsciiChar::LineFeed.is_ascii_blank());
assert!(!AsciiChar::CarriageReturn.is_ascii_blank());
assert!(!AsciiChar::FF.is_ascii_blank());
Source

pub const fn is_whitespace(self) -> bool

Check if the character one of ’ ’, ‘\t’, ‘\n’, ‘\r’, ‘\0xb’ (vertical tab) or ‘\0xc’ (form feed).

Source

pub const fn is_ascii_whitespace(&self) -> bool

Check if the character is a ’ ’, ‘\t’, ‘\n’, ‘\r’ or ‘\0xc’ (form feed).

This method is NOT identical to is_whitespace().

Source

pub const fn is_ascii_control(&self) -> bool

Check if the character is a control character

§Examples
assert_eq!(AsciiChar::new('\0').is_ascii_control(), true);
assert_eq!(AsciiChar::new('n').is_ascii_control(), false);
assert_eq!(AsciiChar::new(' ').is_ascii_control(), false);
assert_eq!(AsciiChar::new('\n').is_ascii_control(), true);
assert_eq!(AsciiChar::new('\t').is_ascii_control(), true);
assert_eq!(AsciiChar::EOT.is_ascii_control(), true);
Source

pub const fn is_ascii_graphic(&self) -> bool

Checks if the character is printable (except space)

§Examples
assert_eq!(AsciiChar::new('n').is_ascii_graphic(), true);
assert_eq!(AsciiChar::new(' ').is_ascii_graphic(), false);
assert_eq!(AsciiChar::new('\n').is_ascii_graphic(), false);
Source

pub const fn is_ascii_printable(&self) -> bool

Checks if the character is printable (including space)

§Examples
assert_eq!(AsciiChar::new('n').is_ascii_printable(), true);
assert_eq!(AsciiChar::new(' ').is_ascii_printable(), true);
assert_eq!(AsciiChar::new('\n').is_ascii_printable(), false);
Source

pub const fn is_lowercase(self) -> bool

Checks if the character is alphabetic and lowercase (a-z).

§Examples
use ascii::AsciiChar;
assert_eq!(AsciiChar::new('a').is_lowercase(), true);
assert_eq!(AsciiChar::new('A').is_lowercase(), false);
assert_eq!(AsciiChar::new('@').is_lowercase(), false);
Source

pub const fn is_ascii_lowercase(&self) -> bool

Checks if the character is alphabetic and lowercase (a-z).

This method is identical to is_lowercase()

Source

pub const fn is_uppercase(self) -> bool

Checks if the character is alphabetic and uppercase (A-Z).

§Examples
assert_eq!(AsciiChar::new('A').is_uppercase(), true);
assert_eq!(AsciiChar::new('a').is_uppercase(), false);
assert_eq!(AsciiChar::new('@').is_uppercase(), false);
Source

pub const fn is_ascii_uppercase(&self) -> bool

Checks if the character is alphabetic and uppercase (A-Z).

This method is identical to is_uppercase()

Source

pub const fn is_ascii_punctuation(&self) -> bool

Checks if the character is punctuation

§Examples
assert_eq!(AsciiChar::new('n').is_ascii_punctuation(), false);
assert_eq!(AsciiChar::new(' ').is_ascii_punctuation(), false);
assert_eq!(AsciiChar::new('_').is_ascii_punctuation(), true);
assert_eq!(AsciiChar::new('~').is_ascii_punctuation(), true);
Source

pub const fn is_ascii_hexdigit(&self) -> bool

Checks if the character is a valid hex digit

§Examples
assert_eq!(AsciiChar::new('5').is_ascii_hexdigit(), true);
assert_eq!(AsciiChar::new('a').is_ascii_hexdigit(), true);
assert_eq!(AsciiChar::new('F').is_ascii_hexdigit(), true);
assert_eq!(AsciiChar::new('G').is_ascii_hexdigit(), false);
assert_eq!(AsciiChar::new(' ').is_ascii_hexdigit(), false);
Source

pub fn as_printable_char(self) -> char

Unicode has printable versions of the ASCII control codes, like ‘␛’.

This function is identical with .as_char() for all values .is_printable() returns true for, but replaces the control codes with those unicodes printable versions.

§Examples
assert_eq!(AsciiChar::new('\0').as_printable_char(), '␀');
assert_eq!(AsciiChar::new('\n').as_printable_char(), '␊');
assert_eq!(AsciiChar::new(' ').as_printable_char(), ' ');
assert_eq!(AsciiChar::new('p').as_printable_char(), 'p');
Source

pub fn make_ascii_uppercase(&mut self)

Replaces letters a to z with A to Z

Source

pub fn make_ascii_lowercase(&mut self)

Replaces letters A to Z with a to z

Source

pub const fn to_ascii_uppercase(&self) -> Self

Maps letters a-z to A-Z and returns any other character unchanged.

§Examples
assert_eq!(AsciiChar::new('u').to_ascii_uppercase().as_char(), 'U');
assert_eq!(AsciiChar::new('U').to_ascii_uppercase().as_char(), 'U');
assert_eq!(AsciiChar::new('2').to_ascii_uppercase().as_char(), '2');
assert_eq!(AsciiChar::new('=').to_ascii_uppercase().as_char(), '=');
assert_eq!(AsciiChar::new('[').to_ascii_uppercase().as_char(), '[');
Source

pub const fn to_ascii_lowercase(&self) -> Self

Maps letters A-Z to a-z and returns any other character unchanged.

§Examples
assert_eq!(AsciiChar::new('U').to_ascii_lowercase().as_char(), 'u');
assert_eq!(AsciiChar::new('u').to_ascii_lowercase().as_char(), 'u');
assert_eq!(AsciiChar::new('2').to_ascii_lowercase().as_char(), '2');
assert_eq!(AsciiChar::new('^').to_ascii_lowercase().as_char(), '^');
assert_eq!(AsciiChar::new('\x7f').to_ascii_lowercase().as_char(), '\x7f');
Source

pub const fn eq_ignore_ascii_case(&self, other: &Self) -> bool

Compares two characters case-insensitively.

Trait Implementations§

Source§

impl AsRef<AsciiStr> for AsciiChar

Source§

fn as_ref(&self) -> &AsciiStr

Converts this type into a shared reference of the (usually inferred) input type.
Source§

impl Clone for AsciiChar

Source§

fn clone(&self) -> AsciiChar

Returns a copy of the value. Read more
1.0.0 · Source§

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

Formats the value using the given formatter. Read more
Source§

impl Default for AsciiChar

Source§

fn default() -> AsciiChar

Returns the “default value” for a type. Read more
Source§

impl Display for AsciiChar

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl From<AsciiChar> for AsciiString

Source§

fn from(ch: AsciiChar) -> Self

Converts to this type from the input type.
Source§

impl From<AsciiChar> for char

Source§

fn from(a: AsciiChar) -> char

Converts to this type from the input type.
Source§

impl From<AsciiChar> for u8

Source§

fn from(a: AsciiChar) -> u8

Converts to this type from the input type.
Source§

impl Hash for AsciiChar

Source§

fn hash<__H: Hasher>(&self, state: &mut __H)

Feeds this value into the given Hasher. Read more
1.3.0 · Source§

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.0 · Source§

fn max(self, other: Self) -> Self
where Self: Sized,

Compares and returns the maximum of two values. Read more
1.21.0 · Source§

fn min(self, other: Self) -> Self
where Self: Sized,

Compares and returns the minimum of two values. Read more
1.50.0 · Source§

fn clamp(self, min: Self, max: Self) -> Self
where Self: Sized,

Restrict a value to a certain interval. Read more
Source§

impl PartialEq<AsciiChar> for char

Source§

fn eq(&self, rhs: &AsciiChar) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl PartialEq<AsciiChar> for u8

Source§

fn eq(&self, rhs: &AsciiChar) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl PartialEq<char> for AsciiChar

Source§

fn eq(&self, rhs: &char) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl PartialEq<u8> for AsciiChar

Source§

fn eq(&self, rhs: &u8) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl PartialEq for AsciiChar

Source§

fn eq(&self, other: &AsciiChar) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl PartialOrd<AsciiChar> for char

Source§

fn partial_cmp(&self, rhs: &AsciiChar) -> Option<Ordering>

This method returns an ordering between self and other values if one exists. Read more
1.0.0 · Source§

fn lt(&self, other: &Rhs) -> bool

Tests less than (for self and other) and is used by the < operator. Read more
1.0.0 · Source§

fn le(&self, other: &Rhs) -> bool

Tests less than or equal to (for self and other) and is used by the <= operator. Read more
1.0.0 · Source§

fn gt(&self, other: &Rhs) -> bool

Tests greater than (for self and other) and is used by the > operator. Read more
1.0.0 · Source§

fn ge(&self, other: &Rhs) -> bool

Tests greater than or equal to (for self and other) and is used by the >= operator. Read more
Source§

impl PartialOrd<AsciiChar> for u8

Source§

fn partial_cmp(&self, rhs: &AsciiChar) -> Option<Ordering>

This method returns an ordering between self and other values if one exists. Read more
1.0.0 · Source§

fn lt(&self, other: &Rhs) -> bool

Tests less than (for self and other) and is used by the < operator. Read more
1.0.0 · Source§

fn le(&self, other: &Rhs) -> bool

Tests less than or equal to (for self and other) and is used by the <= operator. Read more
1.0.0 · Source§

fn gt(&self, other: &Rhs) -> bool

Tests greater than (for self and other) and is used by the > operator. Read more
1.0.0 · Source§

fn ge(&self, other: &Rhs) -> bool

Tests greater than or equal to (for self and other) and is used by the >= operator. Read more
Source§

impl PartialOrd<char> for AsciiChar

Source§

fn partial_cmp(&self, rhs: &char) -> Option<Ordering>

This method returns an ordering between self and other values if one exists. Read more
1.0.0 · Source§

fn lt(&self, other: &Rhs) -> bool

Tests less than (for self and other) and is used by the < operator. Read more
1.0.0 · Source§

fn le(&self, other: &Rhs) -> bool

Tests less than or equal to (for self and other) and is used by the <= operator. Read more
1.0.0 · Source§

fn gt(&self, other: &Rhs) -> bool

Tests greater than (for self and other) and is used by the > operator. Read more
1.0.0 · Source§

fn ge(&self, other: &Rhs) -> bool

Tests greater than or equal to (for self and other) and is used by the >= operator. Read more
Source§

impl PartialOrd<u8> for AsciiChar

Source§

fn partial_cmp(&self, rhs: &u8) -> Option<Ordering>

This method returns an ordering between self and other values if one exists. Read more
1.0.0 · Source§

fn lt(&self, other: &Rhs) -> bool

Tests less than (for self and other) and is used by the < operator. Read more
1.0.0 · Source§

fn le(&self, other: &Rhs) -> bool

Tests less than or equal to (for self and other) and is used by the <= operator. Read more
1.0.0 · Source§

fn gt(&self, other: &Rhs) -> bool

Tests greater than (for self and other) and is used by the > operator. Read more
1.0.0 · Source§

fn ge(&self, other: &Rhs) -> bool

Tests greater than or equal to (for self and other) and is used by the >= operator. Read more
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.0 · Source§

fn lt(&self, other: &Rhs) -> bool

Tests less than (for self and other) and is used by the < operator. Read more
1.0.0 · Source§

fn le(&self, other: &Rhs) -> bool

Tests less than or equal to (for self and other) and is used by the <= operator. Read more
1.0.0 · Source§

fn gt(&self, other: &Rhs) -> bool

Tests greater than (for self and other) and is used by the > operator. Read more
1.0.0 · Source§

fn ge(&self, other: &Rhs) -> bool

Tests greater than or equal to (for self and other) and is used by the >= operator. Read more
Source§

impl ToAsciiChar for AsciiChar

Source§

fn to_ascii_char(self) -> Result<AsciiChar, ToAsciiCharError>

Convert to AsciiChar. Read more
Source§

unsafe fn to_ascii_char_unchecked(self) -> AsciiChar

Convert to AsciiChar without checking that it is an ASCII character. Read more
Source§

impl Copy for AsciiChar

Source§

impl Eq for AsciiChar

Source§

impl StructuralPartialEq for AsciiChar

Auto Trait Implementations§

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> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dst: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dst. 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,

Source§

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>,

Source§

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>,

Source§

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.