pub struct MsgLinesCache {
pub msg_count: usize,
pub last_msg_len: usize,
pub streaming_len: usize,
pub is_loading: bool,
pub bubble_max_width: usize,
pub browse_index: Option<usize>,
pub lines: Vec<Line<'static>>,
pub msg_start_lines: Vec<(usize, usize)>,
pub per_msg_lines: Vec<PerMsgCache>,
pub streaming_stable_lines: Vec<Line<'static>>,
pub streaming_stable_offset: usize,
}Expand description
消息渲染行缓存
Fields§
§msg_count: usize会话消息数量
last_msg_len: usize最后一条消息的内容长度(用于检测流式更新)
streaming_len: usize流式内容长度
is_loading: bool是否正在加载
bubble_max_width: usize气泡最大宽度(窗口变化时需要重算)
browse_index: Option<usize>浏览模式选中索引(None 表示非浏览模式)
lines: Vec<Line<'static>>缓存的渲染行
msg_start_lines: Vec<(usize, usize)>每条消息(按 msg_index)的起始行号(用于浏览模式自动滚动)
per_msg_lines: Vec<PerMsgCache>按消息粒度缓存:每条历史消息的渲染行(key: 消息索引)
streaming_stable_lines: Vec<Line<'static>>流式增量渲染缓存:已完成段落的渲染行
streaming_stable_offset: usize流式增量渲染缓存:已缓存到 streaming_content 的字节偏移
Auto Trait Implementations§
impl Freeze for MsgLinesCache
impl RefUnwindSafe for MsgLinesCache
impl Send for MsgLinesCache
impl Sync for MsgLinesCache
impl Unpin for MsgLinesCache
impl UnsafeUnpin for MsgLinesCache
impl UnwindSafe for MsgLinesCache
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
Source§impl<S> FromSample<S> for S
impl<S> FromSample<S> for S
fn from_sample_(s: S) -> S
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more