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§
Source§impl MeasurableWidget for Rule<'_>
impl MeasurableWidget for Rule<'_>
impl<'a> Eq for Rule<'a>
impl<'a> StructuralPartialEq for Rule<'a>
Auto Trait Implementations§
impl<'a> Freeze 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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.