pub struct AsciiSym(/* private fields */);

Methods from Deref<Target = AsciiChar>§

pub fn is_ascii_alphabetic(&self) -> bool

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

This method is identical to is_alphabetic()

pub 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);

pub fn is_ascii_alphanumeric(&self) -> bool

Check if the character is a letter or number

This method is identical to is_alphanumeric()

pub 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());

pub 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().

pub 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);

pub 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);

pub 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);

pub fn is_ascii_lowercase(&self) -> bool

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

This method is identical to is_lowercase()

pub fn is_ascii_uppercase(&self) -> bool

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

This method is identical to is_uppercase()

pub 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);

pub 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);

pub fn make_ascii_uppercase(&mut self)

Replaces letters a to z with A to Z

pub fn make_ascii_lowercase(&mut self)

Replaces letters A to Z with a to z

pub fn to_ascii_uppercase(&self) -> AsciiChar

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(), '[');

pub fn to_ascii_lowercase(&self) -> AsciiChar

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');

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

Compares two characters case-insensitively.

Trait Implementations§

source§

impl AsMut<<AsciiSym as Wrapper>::Inner> for AsciiSym

source§

fn as_mut(&mut self) -> &mut <Self as Wrapper>::Inner

Converts this type into a mutable reference of the (usually inferred) input type.
source§

impl AsRef<AsciiChar> for AsciiSym

source§

fn as_ref(&self) -> &AsciiChar

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

impl Borrow<AsciiChar> for AsciiSym

source§

fn borrow(&self) -> &AsciiChar

Immutably borrows from an owned value. Read more
source§

impl BorrowMut<<AsciiSym as Wrapper>::Inner> for AsciiSym

source§

fn borrow_mut(&mut self) -> &mut <Self as Wrapper>::Inner

Mutably borrows from an owned value. Read more
source§

impl Clone for AsciiSym

source§

fn clone(&self) -> AsciiSym

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 AsciiSym

source§

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

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

impl Deref for AsciiSym

§

type Target = AsciiChar

The resulting type after dereferencing.
source§

fn deref(&self) -> &Self::Target

Dereferences the value.
source§

impl DerefMut for AsciiSym

source§

fn deref_mut(&mut self) -> &mut Self::Target

Mutably dereferences the value.
source§

impl Display for AsciiSym

source§

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

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

impl From<AsciiChar> for AsciiSym

source§

fn from(v: AsciiChar) -> Self

Converts to this type from the input type.
source§

impl From<AsciiSym> for AsciiChar

source§

fn from(wrapped: AsciiSym) -> Self

Converts to this type from the input type.
source§

impl From<AsciiSym> for u8

source§

fn from(value: AsciiSym) -> Self

Converts to this type from the input type.
source§

impl Hash for AsciiSym

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 AsciiSym

source§

fn cmp(&self, other: &AsciiSym) -> 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 + PartialOrd,

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

impl PartialEq for AsciiSym

source§

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

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

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 AsciiSym

source§

fn partial_cmp(&self, other: &AsciiSym) -> 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

This method 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

This method 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

This method 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

This method tests greater than or equal to (for self and other) and is used by the >= operator. Read more
source§

impl StrictDecode for AsciiSym

source§

fn strict_decode(reader: &mut impl TypedRead) -> Result<Self, DecodeError>

source§

fn strict_read(lim: usize, reader: impl Read) -> Result<Self, DecodeError>

source§

impl StrictDumb for AsciiSym

source§

fn strict_dumb() -> Self

source§

impl StrictEncode for AsciiSym

source§

fn strict_encode<W: TypedWrite>(&self, writer: W) -> Result<W>

source§

fn strict_write(&self, lim: usize, writer: impl Write) -> Result<usize>

source§

impl StrictEnum for AsciiSym

source§

impl StrictSum for AsciiSym

source§

impl StrictType for AsciiSym

source§

const STRICT_LIB_NAME: &'static str = LIB_NAME_STD

source§

fn strict_name() -> Option<TypeName>

source§

impl TryFrom<u8> for AsciiSym

§

type Error = VariantError<u8>

The type returned in the event of a conversion error.
source§

fn try_from(value: u8) -> Result<Self, Self::Error>

Performs the conversion.
source§

impl Wrapper for AsciiSym

§

type Inner = AsciiChar

Inner type wrapped by the current newtype
source§

fn from_inner(inner: Self::Inner) -> Self

Instantiates wrapper type with the inner data
source§

fn as_inner(&self) -> &Self::Inner

Returns reference to the inner representation for the wrapper type
source§

fn into_inner(self) -> Self::Inner

Unwraps the wrapper returning the inner type
source§

fn to_inner(&self) -> Self::Inner
where Self::Inner: Clone,

Clones inner data of the wrapped type and return them
source§

fn copy(&self) -> Self
where Self: Sized, Self::Inner: Copy,

Copies the wrapped type
source§

impl WrapperMut for AsciiSym

source§

fn as_inner_mut(&mut self) -> &mut <Self as Wrapper>::Inner

Returns a mutable reference to the inner representation for the wrapper type
source§

impl Copy for AsciiSym

source§

impl Eq for AsciiSym

source§

impl StructuralEq for AsciiSym

source§

impl StructuralPartialEq for AsciiSym

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
§

impl<Q, K> Comparable<K> for Q
where Q: Ord + ?Sized, K: Borrow<Q> + ?Sized,

§

fn compare(&self, key: &K) -> Ordering

Compare self to key and return their ordering.
§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

§

fn equivalent(&self, key: &K) -> bool

Checks if this value is equivalent to the given key. Read more
§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

§

fn equivalent(&self, key: &K) -> bool

Compare self to key and return true if they are equal.
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.
source§

impl<C> RestrictedCharacter for C
where C: Copy + Into<u8> + TryFrom<u8, Error = VariantError<u8>> + StrictEncode + StrictDumb,