[][src]Struct kanaria::utils::CharsUtils

pub struct CharsUtils;

Methods

impl CharsUtils[src]

pub fn is_narrow<T>(target: T) -> bool where
    T: UCSChar
[src]

半角文字かどうかを判定します。

Examples

use kanaria::utils::CharsUtils;

assert_eq!(CharsUtils::is_narrow('a'), true);
assert_eq!(CharsUtils::is_narrow('A'), true);
assert_eq!(CharsUtils::is_narrow('@'), true);
assert_eq!(CharsUtils::is_narrow('0'), true);
assert_eq!(CharsUtils::is_narrow('ア'), true);
assert_eq!(CharsUtils::is_narrow('ー'), true);

assert_eq!(CharsUtils::is_narrow('a'), false);
assert_eq!(CharsUtils::is_narrow('A'), false);
assert_eq!(CharsUtils::is_narrow('@'), false);
assert_eq!(CharsUtils::is_narrow('0'), false);
assert_eq!(CharsUtils::is_narrow('ア'), false);
assert_eq!(CharsUtils::is_narrow('ー'), false);

pub fn is_wide<T>(target: T) -> bool where
    T: UCSChar
[src]

全角文字かどうかを判定します。

Examples

use kanaria::utils::CharsUtils;

assert_eq!(CharsUtils::is_wide('a'), true);
assert_eq!(CharsUtils::is_wide('A'), true);
assert_eq!(CharsUtils::is_wide('@'), true);
assert_eq!(CharsUtils::is_wide('0'), true);
assert_eq!(CharsUtils::is_wide('ア'), true);
assert_eq!(CharsUtils::is_wide('ー'), true);
 
assert_eq!(CharsUtils::is_wide('a'), false);
assert_eq!(CharsUtils::is_wide('A'), false);
assert_eq!(CharsUtils::is_wide('@'), false);
assert_eq!(CharsUtils::is_wide('0'), false);
assert_eq!(CharsUtils::is_wide('ア'), false);
assert_eq!(CharsUtils::is_wide('ー'), false);

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[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.

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.