Splitter

Trait Splitter 

Source
pub trait Splitter {
    // Required methods
    fn split(&self, text: &str) -> Vec<String>;
    fn split_with_limit(
        &self,
        text: &str,
        max_bytes_per_word: usize,
    ) -> Vec<Vec<u8>>;
}

Required Methods§

Source

fn split(&self, text: &str) -> Vec<String>

Splits a string into words.

Source

fn split_with_limit( &self, text: &str, max_bytes_per_word: usize, ) -> Vec<Vec<u8>>

Splits a string into words and limits the size of each word to max_bytes_per_word. As this function enforces a byte limit, it may split unicode characters. That is, this function does not guarantee that the resulting byte arrays are valid UTF-8.

Implementors§