A character type.
The char
type represents a single character. More specifically, since 'character' isn't a well-defined concept in Unicode, char
is a 'Unicode scalar value', which is similar to, but not the same as, a 'Unicode code point'.
This documentation describes a number of methods and trait implementations on the char
type. For technical reasons, there is additional, separate documentation in the std::char
module as well.
char
is always four bytes in size. This is a different representation than a given character would have as part of a String
. For example:
let v = vec!['h', 'e', 'l', 'l', 'o']; // five elements times four bytes for each element assert_eq!(20, v.len() * std::mem::size_of::<char>()); let s = String::from("hello"); // five elements times one byte per element assert_eq!(5, s.len() * std::mem::size_of::<u8>());
As always, remember that a human intuition for 'character' may not map to Unicode's definitions. For example, despite looking similar, the 'é' character is one Unicode code point while 'é' is two Unicode code points:
let mut chars = "é".chars(); // U+00e9: 'latin small letter e with acute' assert_eq!(Some('\u{00e9}'), chars.next()); assert_eq!(None, chars.next()); let mut chars = "é".chars(); // U+0065: 'latin small letter e' assert_eq!(Some('\u{0065}'), chars.next()); // U+0301: 'combining acute accent' assert_eq!(Some('\u{0301}'), chars.next()); assert_eq!(None, chars.next());
This means that the contents of the first string above will fit into a char
while the contents of the second string will not. Trying to create a char
literal with the contents of the second string gives an error:
error: character literal may only contain one codepoint: 'é' let c = 'é'; ^^^
Another implication of the 4-byte fixed size of a char
is that per-char
processing can end up using a lot more memory:
let s = String::from("love: ❤️"); let v: Vec<char> = s.chars().collect(); assert_eq!(12, std::mem::size_of_val(&s[..])); assert_eq!(32, std::mem::size_of_val(&v[..]));
impl char
[src]
pub fn is_digit(self, radix: u32) -> bool
[src]
Checks if a char
is a digit in the given radix.
A 'radix' here is sometimes also called a 'base'. A radix of two indicates a binary number, a radix of ten, decimal, and a radix of sixteen, hexadecimal, to give some common values. Arbitrary radices are supported.
Compared to is_numeric()
, this function only recognizes the characters 0-9
, a-z
and A-Z
.
'Digit' is defined to be only the following characters:
0-9
a-z
A-Z
For a more comprehensive understanding of 'digit', see is_numeric
.
Panics if given a radix larger than 36.
Basic usage:
Passing a large radix, causing a panic:
pub fn to_digit(self, radix: u32) -> Option<u32>
[src]
Converts a char
to a digit in the given radix.
A 'radix' here is sometimes also called a 'base'. A radix of two indicates a binary number, a radix of ten, decimal, and a radix of sixteen, hexadecimal, to give some common values. Arbitrary radices are supported.
'Digit' is defined to be only the following characters:
0-9
a-z
A-Z
Returns None
if the char
does not refer to a digit in the given radix.
Panics if given a radix larger than 36.
Basic usage:
Passing a non-digit results in failure:
Passing a large radix, causing a panic:
pub fn escape_unicode(self) -> EscapeUnicode
[src]
impl Iterator for EscapeUnicode type Item = char;
Returns an iterator that yields the hexadecimal Unicode escape of a character as char
s.
This will escape characters with the Rust syntax of the form \u{NNNNNN}
where NNNNNN
is a hexadecimal representation.
As an iterator:
Using println!
directly:
Both are equivalent to:
Using to_string
:
pub fn escape_debug(self) -> EscapeDebug
[src]1.20.0
impl Iterator for EscapeDebug type Item = char;
Returns an iterator that yields the literal escape code of a character as char
s.
This will escape the characters similar to the Debug
implementations of str
or char
.
As an iterator:
Using println!
directly:
Both are equivalent to:
Using to_string
:
pub fn escape_default(self) -> EscapeDefault
[src]
impl Iterator for EscapeDefault type Item = char;
Returns an iterator that yields the literal escape code of a character as char
s.
The default is chosen with a bias toward producing literals that are legal in a variety of languages, including C++11 and similar C-family languages. The exact rules are:
\t
.\r
.\n
.'
."
.\
.0x20
.. 0x7e
inclusive is not escaped.escape_unicode
.As an iterator:
Using println!
directly:
Both are equivalent to:
Using to_string
:
pub fn len_utf8(self) -> usize
[src]
Returns the number of bytes this char
would need if encoded in UTF-8.
That number of bytes is always between 1 and 4, inclusive.
Basic usage:
let len = 'A'.len_utf8(); assert_eq!(len, 1); let len = 'ß'.len_utf8(); assert_eq!(len, 2); let len = 'ℝ'.len_utf8(); assert_eq!(len, 3); let len = '💣'.len_utf8(); assert_eq!(len, 4);
The &str
type guarantees that its contents are UTF-8, and so we can compare the length it would take if each code point was represented as a char
vs in the &str
itself:
// as chars let eastern = '東'; let capital = '京'; // both can be represented as three bytes assert_eq!(3, eastern.len_utf8()); assert_eq!(3, capital.len_utf8()); // as a &str, these two are encoded in UTF-8 let tokyo = "東京"; let len = eastern.len_utf8() + capital.len_utf8(); // we can see that they take six bytes total... assert_eq!(6, tokyo.len()); // ... just like the &str assert_eq!(len, tokyo.len());
pub fn len_utf16(self) -> usize
[src]
Returns the number of 16-bit code units this char
would need if encoded in UTF-16.
See the documentation for len_utf8
for more explanation of this concept. This function is a mirror, but for UTF-16 instead of UTF-8.
Basic usage:
pub fn encode_utf8(self, dst: &mut [u8]) -> &mut str
[src]1.15.0
Encodes this character as UTF-8 into the provided byte buffer, and then returns the subslice of the buffer that contains the encoded character.
Panics if the buffer is not large enough. A buffer of length four is large enough to encode any char
.
In both of these examples, 'ß' takes two bytes to encode.
let mut b = [0; 2]; let result = 'ß'.encode_utf8(&mut b); assert_eq!(result, "ß"); assert_eq!(result.len(), 2);
A buffer that's too small:
pub fn encode_utf16(self, dst: &mut [u16]) -> &mut [u16]
[src]1.15.0
Encodes this character as UTF-16 into the provided u16
buffer, and then returns the subslice of the buffer that contains the encoded character.
Panics if the buffer is not large enough. A buffer of length 2 is large enough to encode any char
.
In both of these examples, '𝕊' takes two u16
s to encode.
A buffer that's too small:
pub fn is_alphabetic(self) -> bool
[src]
Returns true
if this char
is an alphabetic code point, and false if not.
Basic usage:
pub fn is_xid_start(self) -> bool
[src]
Returns true
if this char
satisfies the 'XID_Start' Unicode property, and false otherwise.
'XID_Start' is a Unicode Derived Property specified in UAX #31, mostly similar to ID_Start
but modified for closure under NFKx
.
pub fn is_xid_continue(self) -> bool
[src]
Returns true
if this char
satisfies the 'XID_Continue' Unicode property, and false otherwise.
'XID_Continue' is a Unicode Derived Property specified in UAX #31, mostly similar to 'ID_Continue' but modified for closure under NFKx.
pub fn is_lowercase(self) -> bool
[src]
Returns true
if this char
is lowercase.
'Lowercase' is defined according to the terms of the Unicode Derived Core Property Lowercase
.
Basic usage:
pub fn is_uppercase(self) -> bool
[src]
Returns true
if this char
is uppercase.
'Uppercase' is defined according to the terms of the Unicode Derived Core Property Uppercase
.
Basic usage:
pub fn is_whitespace(self) -> bool
[src]
Returns true
if this char
is whitespace.
'Whitespace' is defined according to the terms of the Unicode Derived Core Property White_Space
.
Basic usage:
pub fn is_alphanumeric(self) -> bool
[src]
Returns true
if this char
is alphanumeric.
'Alphanumeric'-ness is defined in terms of the Unicode General Categories 'Nd', 'Nl', 'No' and the Derived Core Property 'Alphabetic'.
Basic usage:
pub fn is_control(self) -> bool
[src]
Returns true
if this char
is a control code point.
'Control code point' is defined in terms of the Unicode General Category Cc
.
Basic usage:
pub fn is_numeric(self) -> bool
[src]
Returns true
if this char
is numeric.
'Numeric'-ness is defined in terms of the Unicode General Categories 'Nd', 'Nl', 'No'.
Basic usage:
pub fn to_lowercase(self) -> ToLowercase
[src]
impl Iterator for ToLowercase type Item = char;
Returns an iterator that yields the lowercase equivalent of a char
as one or more char
s.
If a character does not have a lowercase equivalent, the same character will be returned back by the iterator.
This performs complex unconditional mappings with no tailoring: it maps one Unicode character to its lowercase equivalent according to the Unicode database and the additional complex mappings SpecialCasing.txt
. Conditional mappings (based on context or language) are not considered here.
For a full reference, see here.
As an iterator:
Using println!
directly:
Both are equivalent to:
Using to_string
:
pub fn to_uppercase(self) -> ToUppercase
[src]
impl Iterator for ToUppercase type Item = char;
Returns an iterator that yields the uppercase equivalent of a char
as one or more char
s.
If a character does not have an uppercase equivalent, the same character will be returned back by the iterator.
This performs complex unconditional mappings with no tailoring: it maps one Unicode character to its uppercase equivalent according to the Unicode database and the additional complex mappings SpecialCasing.txt
. Conditional mappings (based on context or language) are not considered here.
For a full reference, see here.
As an iterator:
Using println!
directly:
Both are equivalent to:
Using to_string
:
assert_eq!('c'.to_uppercase().to_string(), "C"); // Sometimes the result is more than one character: assert_eq!('ß'.to_uppercase().to_string(), "SS"); // Characters that do not have both uppercase and lowercase // convert into themselves. assert_eq!('山'.to_uppercase().to_string(), "山");
In Turkish, the equivalent of 'i' in Latin has five forms instead of two:
Note that the lowercase dotted 'i' is the same as the Latin. Therefore:
The value of upper_i
here relies on the language of the text: if we're in en-US
, it should be "I"
, but if we're in tr_TR
, it should be "İ"
. to_uppercase()
does not take this into account, and so:
holds across languages.
pub const fn is_ascii(&self) -> bool
[src]1.23.0
Checks if the value is within the ASCII range.
pub fn to_ascii_uppercase(&self) -> char
[src]1.23.0
Makes a copy of the value in its ASCII upper case equivalent.
ASCII letters 'a' to 'z' are mapped to 'A' to 'Z', but non-ASCII letters are unchanged.
To uppercase the value in-place, use make_ascii_uppercase
.
To uppercase ASCII characters in addition to non-ASCII characters, use to_uppercase
.
pub fn to_ascii_lowercase(&self) -> char
[src]1.23.0
Makes a copy of the value in its ASCII lower case equivalent.
ASCII letters 'A' to 'Z' are mapped to 'a' to 'z', but non-ASCII letters are unchanged.
To lowercase the value in-place, use make_ascii_lowercase
.
To lowercase ASCII characters in addition to non-ASCII characters, use to_lowercase
.
pub fn eq_ignore_ascii_case(&self, other: &char) -> bool
[src]1.23.0
Checks that two values are an ASCII case-insensitive match.
Equivalent to to_ascii_lowercase(a) == to_ascii_lowercase(b)
.
pub fn make_ascii_uppercase(&mut self)
[src]1.23.0
Converts this type to its ASCII upper case equivalent in-place.
ASCII letters 'a' to 'z' are mapped to 'A' to 'Z', but non-ASCII letters are unchanged.
To return a new uppercased value without modifying the existing one, use to_ascii_uppercase
.
pub fn make_ascii_lowercase(&mut self)
[src]1.23.0
Converts this type to its ASCII lower case equivalent in-place.
ASCII letters 'A' to 'Z' are mapped to 'a' to 'z', but non-ASCII letters are unchanged.
To return a new lowercased value without modifying the existing one, use to_ascii_lowercase
.
pub fn is_ascii_alphabetic(&self) -> bool
[src]1.24.0
Checks if the value is an ASCII alphabetic character:
let uppercase_a = 'A'; let uppercase_g = 'G'; let a = 'a'; let g = 'g'; let zero = '0'; let percent = '%'; let space = ' '; let lf = '\n'; let esc: char = 0x1b_u8.into(); assert!(uppercase_a.is_ascii_alphabetic()); assert!(uppercase_g.is_ascii_alphabetic()); assert!(a.is_ascii_alphabetic()); assert!(g.is_ascii_alphabetic()); assert!(!zero.is_ascii_alphabetic()); assert!(!percent.is_ascii_alphabetic()); assert!(!space.is_ascii_alphabetic()); assert!(!lf.is_ascii_alphabetic()); assert!(!esc.is_ascii_alphabetic());
pub fn is_ascii_uppercase(&self) -> bool
[src]1.24.0
Checks if the value is an ASCII uppercase character: U+0041 'A' ..= U+005A 'Z'.
let uppercase_a = 'A'; let uppercase_g = 'G'; let a = 'a'; let g = 'g'; let zero = '0'; let percent = '%'; let space = ' '; let lf = '\n'; let esc: char = 0x1b_u8.into(); assert!(uppercase_a.is_ascii_uppercase()); assert!(uppercase_g.is_ascii_uppercase()); assert!(!a.is_ascii_uppercase()); assert!(!g.is_ascii_uppercase()); assert!(!zero.is_ascii_uppercase()); assert!(!percent.is_ascii_uppercase()); assert!(!space.is_ascii_uppercase()); assert!(!lf.is_ascii_uppercase()); assert!(!esc.is_ascii_uppercase());
pub fn is_ascii_lowercase(&self) -> bool
[src]1.24.0
Checks if the value is an ASCII lowercase character: U+0061 'a' ..= U+007A 'z'.
let uppercase_a = 'A'; let uppercase_g = 'G'; let a = 'a'; let g = 'g'; let zero = '0'; let percent = '%'; let space = ' '; let lf = '\n'; let esc: char = 0x1b_u8.into(); assert!(!uppercase_a.is_ascii_lowercase()); assert!(!uppercase_g.is_ascii_lowercase()); assert!(a.is_ascii_lowercase()); assert!(g.is_ascii_lowercase()); assert!(!zero.is_ascii_lowercase()); assert!(!percent.is_ascii_lowercase()); assert!(!space.is_ascii_lowercase()); assert!(!lf.is_ascii_lowercase()); assert!(!esc.is_ascii_lowercase());
pub fn is_ascii_alphanumeric(&self) -> bool
[src]1.24.0
Checks if the value is an ASCII alphanumeric character:
let uppercase_a = 'A'; let uppercase_g = 'G'; let a = 'a'; let g = 'g'; let zero = '0'; let percent = '%'; let space = ' '; let lf = '\n'; let esc: char = 0x1b_u8.into(); assert!(uppercase_a.is_ascii_alphanumeric()); assert!(uppercase_g.is_ascii_alphanumeric()); assert!(a.is_ascii_alphanumeric()); assert!(g.is_ascii_alphanumeric()); assert!(zero.is_ascii_alphanumeric()); assert!(!percent.is_ascii_alphanumeric()); assert!(!space.is_ascii_alphanumeric()); assert!(!lf.is_ascii_alphanumeric()); assert!(!esc.is_ascii_alphanumeric());
pub fn is_ascii_digit(&self) -> bool
[src]1.24.0
Checks if the value is an ASCII decimal digit: U+0030 '0' ..= U+0039 '9'.
let uppercase_a = 'A'; let uppercase_g = 'G'; let a = 'a'; let g = 'g'; let zero = '0'; let percent = '%'; let space = ' '; let lf = '\n'; let esc: char = 0x1b_u8.into(); assert!(!uppercase_a.is_ascii_digit()); assert!(!uppercase_g.is_ascii_digit()); assert!(!a.is_ascii_digit()); assert!(!g.is_ascii_digit()); assert!(zero.is_ascii_digit()); assert!(!percent.is_ascii_digit()); assert!(!space.is_ascii_digit()); assert!(!lf.is_ascii_digit()); assert!(!esc.is_ascii_digit());
pub fn is_ascii_hexdigit(&self) -> bool
[src]1.24.0
Checks if the value is an ASCII hexadecimal digit:
let uppercase_a = 'A'; let uppercase_g = 'G'; let a = 'a'; let g = 'g'; let zero = '0'; let percent = '%'; let space = ' '; let lf = '\n'; let esc: char = 0x1b_u8.into(); assert!(uppercase_a.is_ascii_hexdigit()); assert!(!uppercase_g.is_ascii_hexdigit()); assert!(a.is_ascii_hexdigit()); assert!(!g.is_ascii_hexdigit()); assert!(zero.is_ascii_hexdigit()); assert!(!percent.is_ascii_hexdigit()); assert!(!space.is_ascii_hexdigit()); assert!(!lf.is_ascii_hexdigit()); assert!(!esc.is_ascii_hexdigit());
pub fn is_ascii_punctuation(&self) -> bool
[src]1.24.0
Checks if the value is an ASCII punctuation character:
! " # $ % & ' ( ) * + , - . /
, or: ; < = > ? @
, or[ \ ] ^ _ `
, or{ | } ~
let uppercase_a = 'A'; let uppercase_g = 'G'; let a = 'a'; let g = 'g'; let zero = '0'; let percent = '%'; let space = ' '; let lf = '\n'; let esc: char = 0x1b_u8.into(); assert!(!uppercase_a.is_ascii_punctuation()); assert!(!uppercase_g.is_ascii_punctuation()); assert!(!a.is_ascii_punctuation()); assert!(!g.is_ascii_punctuation()); assert!(!zero.is_ascii_punctuation()); assert!(percent.is_ascii_punctuation()); assert!(!space.is_ascii_punctuation()); assert!(!lf.is_ascii_punctuation()); assert!(!esc.is_ascii_punctuation());
pub fn is_ascii_graphic(&self) -> bool
[src]1.24.0
Checks if the value is an ASCII graphic character: U+0021 '!' ..= U+007E '~'.
let uppercase_a = 'A'; let uppercase_g = 'G'; let a = 'a'; let g = 'g'; let zero = '0'; let percent = '%'; let space = ' '; let lf = '\n'; let esc: char = 0x1b_u8.into(); assert!(uppercase_a.is_ascii_graphic()); assert!(uppercase_g.is_ascii_graphic()); assert!(a.is_ascii_graphic()); assert!(g.is_ascii_graphic()); assert!(zero.is_ascii_graphic()); assert!(percent.is_ascii_graphic()); assert!(!space.is_ascii_graphic()); assert!(!lf.is_ascii_graphic()); assert!(!esc.is_ascii_graphic());
pub fn is_ascii_whitespace(&self) -> bool
[src]1.24.0
Checks if the value is an ASCII whitespace character: U+0020 SPACE, U+0009 HORIZONTAL TAB, U+000A LINE FEED, U+000C FORM FEED, or U+000D CARRIAGE RETURN.
Rust uses the WhatWG Infra Standard's definition of ASCII whitespace. There are several other definitions in wide use. For instance, the POSIX locale includes U+000B VERTICAL TAB as well as all the above characters, but—from the very same specification—the default rule for "field splitting" in the Bourne shell considers only SPACE, HORIZONTAL TAB, and LINE FEED as whitespace.
If you are writing a program that will process an existing file format, check what that format's definition of whitespace is before using this function.
let uppercase_a = 'A'; let uppercase_g = 'G'; let a = 'a'; let g = 'g'; let zero = '0'; let percent = '%'; let space = ' '; let lf = '\n'; let esc: char = 0x1b_u8.into(); assert!(!uppercase_a.is_ascii_whitespace()); assert!(!uppercase_g.is_ascii_whitespace()); assert!(!a.is_ascii_whitespace()); assert!(!g.is_ascii_whitespace()); assert!(!zero.is_ascii_whitespace()); assert!(!percent.is_ascii_whitespace()); assert!(space.is_ascii_whitespace()); assert!(lf.is_ascii_whitespace()); assert!(!esc.is_ascii_whitespace());
pub fn is_ascii_control(&self) -> bool
[src]1.24.0
Checks if the value is an ASCII control character: U+0000 NUL ..= U+001F UNIT SEPARATOR, or U+007F DELETE. Note that most ASCII whitespace characters are control characters, but SPACE is not.
let uppercase_a = 'A'; let uppercase_g = 'G'; let a = 'a'; let g = 'g'; let zero = '0'; let percent = '%'; let space = ' '; let lf = '\n'; let esc: char = 0x1b_u8.into(); assert!(!uppercase_a.is_ascii_control()); assert!(!uppercase_g.is_ascii_control()); assert!(!a.is_ascii_control()); assert!(!g.is_ascii_control()); assert!(!zero.is_ascii_control()); assert!(!percent.is_ascii_control()); assert!(!space.is_ascii_control()); assert!(lf.is_ascii_control()); assert!(esc.is_ascii_control());
impl TryFrom<u32> for char
[src]1.34.0
type Error = CharTryFromError
The type returned in the event of a conversion error.
fn try_from(i: u32) -> Result<char, <char as TryFrom<u32>>::Error>
[src]
impl Copy for char
[src]
impl Default for char
[src]
impl Hash for char
[src]
fn hash<H>(&self, state: &mut H) where
H: Hasher,
[src]
fn hash_slice<H>(data: &[Self], state: &mut H) where
H: Hasher,
[src]1.3.0
Feeds a slice of this type into the given [Hasher
]. Read more
impl Clone for char
[src]
fn clone(&self) -> char
[src]
fn clone_from(&mut self, source: &Self)
[src]
Performs copy-assignment from source
. Read more
impl Eq for char
[src]
impl PartialOrd<char> for char
[src]
fn partial_cmp(&self, other: &char) -> Option<Ordering>
[src]
fn lt(&self, other: &char) -> bool
[src]
fn le(&self, other: &char) -> bool
[src]
fn ge(&self, other: &char) -> bool
[src]
fn gt(&self, other: &char) -> bool
[src]
impl Ord for char
[src]
fn cmp(&self, other: &char) -> Ordering
[src]
fn max(self, other: Self) -> Self
[src]1.21.0
Compares and returns the maximum of two values. Read more
fn min(self, other: Self) -> Self
[src]1.21.0
Compares and returns the minimum of two values. Read more
fn clamp(self, min: Self, max: Self) -> Self
[src]
Restrict a value to a certain interval. Read more
impl Debug for char
[src]
impl<'a> Pattern<'a> for char
[src]
Searches for chars that are equal to a given char
type Searcher = CharSearcher<'a>
Associated searcher for this pattern
fn into_searcher(self, haystack: &'a str) -> <char as Pattern<'a>>::Searcher
[src]
fn is_contained_in(self, haystack: &'a str) -> bool
[src]
fn is_prefix_of(self, haystack: &'a str) -> bool
[src]
fn is_suffix_of(self, haystack: &'a str) -> bool where
<char as Pattern<'a>>::Searcher: ReverseSearcher<'a>,
[src]
impl PartialEq<char> for char
[src]
impl Display for char
[src]
impl From<u8> for char
[src]1.13.0
Maps a byte in 0x00..=0xFF to a char
whose code point has the same value, in U+0000..=U+00FF.
Unicode is designed such that this effectively decodes bytes with the character encoding that IANA calls ISO-8859-1. This encoding is compatible with ASCII.
Note that this is different from ISO/IEC 8859-1 a.k.a. ISO 8859-1 (with one less hyphen), which leaves some "blanks", byte values that are not assigned to any character. ISO-8859-1 (the IANA one) assigns them to the C0 and C1 control codes.
Note that this is also different from Windows-1252 a.k.a. code page 1252, which is a superset ISO/IEC 8859-1 that assigns some (not all!) blanks to punctuation and various Latin characters.
To confuse things further, on the Web ascii
, iso-8859-1
, and windows-1252
are all aliases for a superset of Windows-1252 that fills the remaining blanks with corresponding C0 and C1 control codes.
impl FromStr for char
[src]1.20.0
type Err = ParseCharError
The associated error which can be returned from parsing.
fn from_str(s: &str) -> Result<char, <char as FromStr>::Err>
[src]
impl AsciiExt for char
[src]
type Owned = char
Container type for copied ASCII characters.
fn is_ascii(&self) -> bool
[src]
fn to_ascii_uppercase(&self) -> Self::Owned
[src]
fn to_ascii_lowercase(&self) -> Self::Owned
[src]
fn eq_ignore_ascii_case(&self, o: &Self) -> bool
[src]
fn make_ascii_uppercase(&mut self)
[src]
fn make_ascii_lowercase(&mut self)
[src]
impl UnwindSafe for char
impl RefUnwindSafe for char
impl Unpin for char
impl Send for char
impl Sync for char
impl<'a, F> Pattern<'a> for F where
F: FnMut(char) -> bool,
[src]
type Searcher = CharPredicateSearcher<'a, F>
Associated searcher for this pattern
fn into_searcher(self, haystack: &'a str) -> CharPredicateSearcher<'a, F>
[src]
fn is_contained_in(self, haystack: &'a str) -> bool
[src]
fn is_prefix_of(self, haystack: &'a str) -> bool
[src]
fn is_suffix_of(self, haystack: &'a str) -> bool where
CharPredicateSearcher<'a, F>: ReverseSearcher<'a>,
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
impl<T> From<T> for T
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
fn borrow(&self) -> &T
[src]
impl<'_, F> Future for &'_ mut F where F: Unpin + Future + ?Sized, type Output = <F as Future>::Output; impl<'_, I> Iterator for &'_ mut I where I: Iterator + ?Sized, type Item = <I as Iterator>::Item; impl<'_, R: Read + ?Sized> Read for &'_ mut R impl<'_, W: Write + ?Sized> Write for &'_ mut W
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
fn borrow_mut(&mut self) -> &mut T
[src]
impl<'_, F> Future for &'_ mut F where F: Unpin + Future + ?Sized, type Output = <F as Future>::Output; impl<'_, I> Iterator for &'_ mut I where I: Iterator + ?Sized, type Item = <I as Iterator>::Item; impl<'_, R: Read + ?Sized> Read for &'_ mut R impl<'_, W: Write + ?Sized> Write for &'_ mut W
impl<T> Any for T where
T: 'static + ?Sized,
[src]
impl<T> ToOwned for T where
T: Clone,
[src]
type Owned = T
The resulting type after obtaining ownership.
fn to_owned(&self) -> T
[src]
fn clone_into(&self, target: &mut T)
[src]
impl<T> ToString for T where
T: Display + ?Sized,
[src]
© 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/primitive.char.html