[][src]Struct tsur::ascii::ascii::ASCII

pub struct ASCII { /* fields omitted */ }

Implementations

impl ASCII[src]

pub fn new() -> ASCII[src]

Creates new instance of ASCII structure.

Examples

let ascii = ASCII::new();

pub fn count_ascii_characters(self, content: &str) -> HashMap<char, usize>[src]

Returns hashmap of how many times each character occur in a content.

Arguments

  • content - A string slice in which we want to count character occurrences

Examples

Basic usage:

let content = "ABA→";
let mut expected: HashMap<char, usize> = HashMap::new();
expected.insert('A', 2);
expected.insert('B', 1);
expected.insert('→', 1);

let ascii = ASCII::new();
let result = ascii.count_ascii_characters(content);

assert_eq!(expected, result);

pub fn get_ascii(self) -> HashMap<char, usize>[src]

Returns result hashmap character occurrences.

Trait Implementations

impl Debug for ASCII[src]

impl Eq for ASCII[src]

impl PartialEq<ASCII> for ASCII[src]

impl StructuralEq for ASCII[src]

impl StructuralPartialEq for ASCII[src]

Auto Trait Implementations

impl RefUnwindSafe for ASCII

impl Send for ASCII

impl Sync for ASCII

impl Unpin for ASCII

impl UnwindSafe for ASCII

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.