pub struct ReadTime {
pub total_seconds: u64,
pub formatted: String,
pub word_count: usize,
pub image_count: usize,
pub code_block_count: usize,
}Expand description
阅读时间估算结果
Fields§
§total_seconds: u64总阅读时间(秒)
这是向上取整后的总秒数,包括文本阅读时间、图片额外时间和代码块额外时间。
formatted: String格式化后的阅读时间字符串
将秒数转换为人类友好的格式,例如 “30秒”、“5分钟” 或 “2分30秒”。
word_count: usize单词数量
根据是否为中文文本,分别采用不同的计数方式:
- 中文:计算非空白字符数
- 英文:计算空格分隔的单词数
image_count: usize图片数量
Markdown 中  格式的图片数量。
code_block_count: usize代码块数量
Markdown 中 code 格式的代码块数量。
Trait Implementations§
impl StructuralPartialEq for ReadTime
Auto Trait Implementations§
impl Freeze for ReadTime
impl RefUnwindSafe for ReadTime
impl Send for ReadTime
impl Sync for ReadTime
impl Unpin for ReadTime
impl UnwindSafe for ReadTime
Blanket Implementations§
§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§unsafe fn clone_to_uninit(&self, dest: *mut u8)
unsafe fn clone_to_uninit(&self, dest: *mut u8)
🔬This is a nightly-only experimental API. (
clone_to_uninit)