pub struct Border {
pub insets: Insets,
pub color: Color,
pub style: BorderStyle,
}Expand description
A widget border: per-side widths, a colour, and a line style.
Fields§
§insets: InsetsPer-side border widths (logical pixels).
color: ColorBorder colour.
style: BorderStyleLine style.
Implementations§
Source§impl Border
impl Border
Sourcepub fn new(insets: Insets, color: Color, style: BorderStyle) -> Self
pub fn new(insets: Insets, color: Color, style: BorderStyle) -> Self
A border with explicit per-side widths.
Sourcepub fn with_style(self, style: BorderStyle) -> Self
pub fn with_style(self, style: BorderStyle) -> Self
Builder: replace the line style.
Sourcepub fn with_color(self, color: Color) -> Self
pub fn with_color(self, color: Color) -> Self
Builder: replace the colour.
Sourcepub fn is_none(&self) -> bool
pub fn is_none(&self) -> bool
Returns true if the border occupies no layout space or is invisible.
Sourcepub fn content_rect(&self, rect: Rect) -> Rect
pub fn content_rect(&self, rect: Rect) -> Rect
The content rectangle after subtracting the border widths from rect.
Trait Implementations§
impl Copy for Border
impl StructuralPartialEq for Border
Auto Trait Implementations§
impl Freeze for Border
impl RefUnwindSafe for Border
impl Send for Border
impl Sync for Border
impl Unpin for Border
impl UnsafeUnpin for Border
impl UnwindSafe for Border
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