pub struct MemoryOptimizedTextItem<'a> {
pub text: Cow<'a, str>,
pub text_type: &'static str,
pub original_length: usize,
pub is_translated: bool,
}
Expand description
内存优化的文本项
Fields§
§text: Cow<'a, str>
使用Cow避免不必要的字符串分配
text_type: &'static str
文本类型(使用&’static str减少内存使用)
original_length: usize
原始长度(用于统计)
is_translated: bool
是否已翻译
Implementations§
Source§impl<'a> MemoryOptimizedTextItem<'a>
impl<'a> MemoryOptimizedTextItem<'a>
Trait Implementations§
Source§impl<'a> Clone for MemoryOptimizedTextItem<'a>
impl<'a> Clone for MemoryOptimizedTextItem<'a>
Source§fn clone(&self) -> MemoryOptimizedTextItem<'a>
fn clone(&self) -> MemoryOptimizedTextItem<'a>
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreAuto Trait Implementations§
impl<'a> Freeze for MemoryOptimizedTextItem<'a>
impl<'a> RefUnwindSafe for MemoryOptimizedTextItem<'a>
impl<'a> Send for MemoryOptimizedTextItem<'a>
impl<'a> Sync for MemoryOptimizedTextItem<'a>
impl<'a> Unpin for MemoryOptimizedTextItem<'a>
impl<'a> UnwindSafe for MemoryOptimizedTextItem<'a>
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