Struct ListFace
pub struct ListFace<'a> { /* private fields */ }Expand description
The list’s painting and measuring, without the widget around it.
A painting app can use this directly when it wants the list’s geometry and mechanics but its own chrome around them.
Implementations§
§impl<'a> ListFace<'a>
impl<'a> ListFace<'a>
pub fn new( lines: &'a [ConversationLine], clock: ConversationClock, ) -> ListFace<'a>
pub fn height(&self, text: &mut TextRenderer, theme: &Theme, width: f64) -> f64
pub fn height(&self, text: &mut TextRenderer, theme: &Theme, width: f64) -> f64
The list’s height at width, keeping nothing between calls.
pub fn height_in(
&self,
cache: &mut ListCache,
text: &mut TextRenderer,
theme: &Theme,
width: f64,
) -> f64
pub fn height_in( &self, cache: &mut ListCache, text: &mut TextRenderer, theme: &Theme, width: f64, ) -> f64
The list’s height at width, reusing what cache measured last time.
A height does not depend on where the rows start, so this answers from the kept rows wherever a last frame placed them, and places them only when the conversation or the column changed.
pub fn paint(&self, paint: &mut PaintCtx<'_>, rect: Rect)
pub fn paint(&self, paint: &mut PaintCtx<'_>, rect: Rect)
Paint the list from rect’s top left, rect’s width wide, keeping
nothing between frames.
pub fn paint_in(
&self,
paint: &mut PaintCtx<'_>,
rect: Rect,
viewport: Option<Rect>,
cache: &mut ListCache,
)
pub fn paint_in( &self, paint: &mut PaintCtx<'_>, rect: Rect, viewport: Option<Rect>, cache: &mut ListCache, )
Paint the rows of rect that meet viewport — all of them when it is
None — reusing and keeping cache’s measurements.
A row outside the viewport is neither measured again (its kept box is still right) nor shaped: the frame costs what is on screen, not what the conversation holds.
Auto Trait Implementations§
impl<'a> Freeze for ListFace<'a>
impl<'a> RefUnwindSafe for ListFace<'a>
impl<'a> Send for ListFace<'a>
impl<'a> Sync for ListFace<'a>
impl<'a> Unpin for ListFace<'a>
impl<'a> UnsafeUnpin for ListFace<'a>
impl<'a> UnwindSafe for ListFace<'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
§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can
then be further downcast into Box<ConcreteType> where ConcreteType implements Trait.§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be
further downcast into Rc<ConcreteType> where ConcreteType implements Trait.§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>, which can then be
downcast into Box<dyn ConcreteType> where ConcreteType implements Trait.§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Rc<Trait> (where Trait: Downcast) to Rc<Any>, which can then be further
downcast into Rc<ConcreteType> where ConcreteType implements Trait.§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.§impl<T> DowncastSend for T
impl<T> DowncastSend for T
§impl<T> DowncastSync for T
impl<T> DowncastSync for T
§impl<T> DowncastSync for T
impl<T> DowncastSync for T
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§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>
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>
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