pub struct View {Show 14 fields
pub direction: Direction,
pub border: Option<BorderType>,
pub border_style: Style,
pub title: Option<String>,
pub title_bottom: Option<String>,
pub title_style: Style,
pub title_bottom_style: Style,
pub padding: Cells,
pub padding_top: Option<Cells>,
pub padding_bottom: Option<Cells>,
pub padding_left: Option<Cells>,
pub padding_right: Option<Cells>,
pub width: WidthConstraint,
pub style: Style,
}Expand description
A unified layout container with optional borders, padding, and background.
See the module-level docs for examples.
Fields§
§direction: DirectionLayout direction. Defaults to Direction::Column (vertical).
border: Option<BorderType>Border type. None means no border (default).
border_style: StyleStyle applied to the border lines.
title: Option<String>Title rendered at the top of the View. Most useful with a border.
title_bottom: Option<String>Title rendered at the bottom of the View. Most useful with a border.
title_style: StyleStyle applied to the top title text.
title_bottom_style: StyleStyle applied to the bottom title text.
padding: CellsBase padding applied to all sides (default 0). Each side uses this
value unless overridden by a side-specific field (padding_top, etc.).
Accepts bare integer literals in the element! macro: padding: 1.
padding_top: Option<Cells>Padding above content. Overrides padding for the top side.
padding_bottom: Option<Cells>Padding below content. Overrides padding for the bottom side.
padding_left: Option<Cells>Padding left of content. Overrides padding for the left side.
padding_right: Option<Cells>Padding right of content. Overrides padding for the right side.
width: WidthConstraintWidth constraint for this View when inside a Direction::Row parent.
style: StyleBackground/foreground style applied to the entire View area.
Implementations§
Source§impl View
impl View
Sourcepub fn builder() -> ViewBuilder<((), (), (), (), (), (), (), (), (), (), (), (), (), ())>
pub fn builder() -> ViewBuilder<((), (), (), (), (), (), (), (), (), (), (), (), (), ())>
Create a builder for building View.
On the builder, call .direction(...)(optional), .border(...)(optional), .border_style(...)(optional), .title(...)(optional), .title_bottom(...)(optional), .title_style(...)(optional), .title_bottom_style(...)(optional), .padding(...)(optional), .padding_top(...)(optional), .padding_bottom(...)(optional), .padding_left(...)(optional), .padding_right(...)(optional), .width(...)(optional), .style(...)(optional) to set the values of the fields.
Finally, call .build() to create the instance of View.
Trait Implementations§
Source§impl ChildCollector for View
impl ChildCollector for View
Auto Trait Implementations§
impl Freeze for View
impl RefUnwindSafe for View
impl Send for View
impl Sync for View
impl Unpin for View
impl UnsafeUnpin for View
impl UnwindSafe for View
Blanket Implementations§
Source§impl<T, V> AddTo<DataChildren<T>> for Vwhere
V: Into<T>,
impl<T, V> AddTo<DataChildren<T>> for Vwhere
V: Into<T>,
Source§type Handle<'a> = DataHandle
where
T: 'a
type Handle<'a> = DataHandle where T: 'a
.key() / .width() chaining.Source§fn add_to(self, collector: &mut DataChildren<T>) -> DataHandle
fn add_to(self, collector: &mut DataChildren<T>) -> DataHandle
.key() and .width().Source§impl<C> AddTo<Elements> for Cwhere
C: Component,
impl<C> AddTo<Elements> for Cwhere
C: Component,
Source§type Handle<'a> = ElementHandle<'a>
type Handle<'a> = ElementHandle<'a>
.key() / .width() chaining.Source§fn add_to(self, els: &mut Elements) -> ElementHandle<'_>
fn add_to(self, els: &mut Elements) -> ElementHandle<'_>
.key() and .width().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
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