pub struct Rule<'a> { /* private fields */ }Expand description
A horizontal rule / divider.
Renders a single-row horizontal line using a border character, optionally with a title inset at the given alignment.
§Examples
ⓘ
use ftui_widgets::rule::Rule;
use ftui_widgets::block::Alignment;
// Simple divider
let rule = Rule::new();
// Titled divider, centered
let rule = Rule::new()
.title("Section")
.title_alignment(Alignment::Center);Implementations§
Source§impl<'a> Rule<'a>
impl<'a> Rule<'a>
Sourcepub fn new() -> Self
pub fn new() -> Self
Create a new rule with default settings (square horizontal line, no title).
Sourcepub fn title_alignment(self, alignment: Alignment) -> Self
pub fn title_alignment(self, alignment: Alignment) -> Self
Set the title alignment.
Sourcepub fn title_style(self, style: Style) -> Self
pub fn title_style(self, style: Style) -> Self
Set a separate style for the title text.
If not set, the rule’s main style is used for the title.
Sourcepub fn border_type(self, border_type: BorderType) -> Self
pub fn border_type(self, border_type: BorderType) -> Self
Set the border type (determines the line character).
Trait Implementations§
impl<'a> Eq for Rule<'a>
Source§impl MeasurableWidget for Rule<'_>
impl MeasurableWidget for Rule<'_>
impl<'a> StructuralPartialEq for Rule<'a>
Auto Trait Implementations§
impl<'a> Forget for Rule<'a>
impl<'a> Freeze for Rule<'a>
impl<'a> Move for Rule<'a>
impl<'a> RefUnwindSafe for Rule<'a>
impl<'a> Send for Rule<'a>
impl<'a> Sync for Rule<'a>
impl<'a> Unpin for Rule<'a>
impl<'a> UnsafeUnpin for Rule<'a>
impl<'a> UnwindSafe for Rule<'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