pub struct TextCounts {
pub words: usize,
pub characters: usize,
pub characters_without_spaces: usize,
pub paragraphs: usize,
}Expand description
Statistics over the text a reader sees. See Doc::counts for the rules
each field is counted by, and crate::counts for what “sees” means.
Fields§
§words: usizeWords, by UAX#29 word segmentation: a segment holding at least one
alphabetic or numeric character. So don't is one, 3.14 is one, a
lone — is none — and well-known is two, which is what the
algorithm says and what every other UAX#29 counter reports.
characters: usizeCharacters as a reader counts them — grapheme clusters, whitespace included. An emoji family and an accented letter are each one.
characters_without_spaces: usizeThe same, less every whitespace grapheme.
paragraphs: usizeBlock-level text containers holding at least one non-whitespace character: a paragraph, a heading, each item of a list, each paragraph inside a blockquote, a whole code block, a whole table.
Trait Implementations§
Source§impl Clone for TextCounts
impl Clone for TextCounts
Source§fn clone(&self) -> TextCounts
fn clone(&self) -> TextCounts
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreimpl Copy for TextCounts
Source§impl Debug for TextCounts
impl Debug for TextCounts
Source§impl Default for TextCounts
impl Default for TextCounts
Source§fn default() -> TextCounts
fn default() -> TextCounts
Returns the “default value” for a type. Read more
impl Eq for TextCounts
Source§impl PartialEq for TextCounts
impl PartialEq for TextCounts
impl StructuralPartialEq for TextCounts
Auto Trait Implementations§
impl Freeze for TextCounts
impl RefUnwindSafe for TextCounts
impl Send for TextCounts
impl Sync for TextCounts
impl Unpin for TextCounts
impl UnsafeUnpin for TextCounts
impl UnwindSafe for TextCounts
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more