pub struct ListItemPresentation<'a, T> { /* private fields */ }Expand description
Typed formatting and optional role-style overrides for List items.
This policy is separate from ListPresentation, which remains the
type-independent List-wide presentation stored by a Theme. During
composition, the formatter is evaluated once per visible item and the style
callback once for each List role. The composed frame retains only their text
and style results.
Implementations§
Source§impl<'a, T: 'a> ListItemPresentation<'a, T>
impl<'a, T: 'a> ListItemPresentation<'a, T>
Sourcepub fn new<F>(format: F) -> Self
pub fn new<F>(format: F) -> Self
Creates an item presentation with a custom formatter and no style overrides.
Sourcepub fn item_style<S>(self, item_style: S) -> Self
pub fn item_style<S>(self, item_style: S) -> Self
Replaces the per-item role-style policy.
None keeps the ListPresentation role default. Some(style)
replaces that complete style rather than layering over it.
Source§impl<'a, T> ListItemPresentation<'a, T>where
T: Display + 'a,
impl<'a, T> ListItemPresentation<'a, T>where
T: Display + 'a,
Sourcepub fn display() -> Self
pub fn display() -> Self
Uses the value’s canonical fmt::Display representation.
Trait Implementations§
Source§impl<'a, T: Clone> Clone for ListItemPresentation<'a, T>
impl<'a, T: Clone> Clone for ListItemPresentation<'a, T>
Source§fn clone(&self) -> ListItemPresentation<'a, T>
fn clone(&self) -> ListItemPresentation<'a, T>
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 moreAuto Trait Implementations§
impl<'a, T> Freeze for ListItemPresentation<'a, T>
impl<'a, T> !RefUnwindSafe for ListItemPresentation<'a, T>
impl<'a, T> !Send for ListItemPresentation<'a, T>
impl<'a, T> !Sync for ListItemPresentation<'a, T>
impl<'a, T> Unpin for ListItemPresentation<'a, T>
impl<'a, T> UnsafeUnpin for ListItemPresentation<'a, T>
impl<'a, T> !UnwindSafe for ListItemPresentation<'a, T>
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