RoundedDashedBorder

Struct RoundedDashedBorder 

Source
pub struct RoundedDashedBorder(pub Borders);
Expand description

A dashed border with rounded corners.

This is a wrapper around Borders with Deref and DerefMut implementations for convenient access to the underlying Borders configuration.

§Examples

use ratatui_garnish::border::{Borders, RoundedDashedBorder};

let border = RoundedDashedBorder::default();
let custom = RoundedDashedBorder::new(Borders::TOP | Borders::BOTTOM);

Tuple Fields§

§0: Borders

Implementations§

Source§

impl RoundedDashedBorder

Source

pub const fn new(borders: Borders) -> Self

Creates a new border with the specified configuration.

Methods from Deref<Target = Borders>§

Source

pub const NONE: Self

Source

pub const TOP: Self

Source

pub const RIGHT: Self

Source

pub const BOTTOM: Self

Source

pub const LEFT: Self

Source

pub const ALL: Self

Source

pub fn bits(&self) -> u8

Get the underlying bits value.

The returned value is exactly the bits set in this flags value.

Source

pub fn is_empty(&self) -> bool

Whether all bits in this flags value are unset.

Source

pub fn is_all(&self) -> bool

Whether all known bits in this flags value are set.

Source

pub fn intersects(&self, other: Self) -> bool

Whether any set bits in a source flags value are also set in a target flags value.

Source

pub fn contains(&self, other: Self) -> bool

Whether all set bits in a source flags value are also set in a target flags value.

Source

pub fn insert(&mut self, other: Self)

The bitwise or (|) of the bits in two flags values.

Source

pub fn remove(&mut self, other: Self)

The intersection of a source flags value with the complement of a target flags value (&!).

This method is not equivalent to self & !other when other has unknown bits set. remove won’t truncate other, but the ! operator will.

Source

pub fn toggle(&mut self, other: Self)

The bitwise exclusive-or (^) of the bits in two flags values.

Source

pub fn set(&mut self, other: Self, value: bool)

Call insert when value is true or remove when value is false.

Source

pub fn iter(&self) -> Iter<Borders>

Yield a set of contained flags values.

Each yielded flags value will correspond to a defined named flag. Any unknown bits will be yielded together as a final flags value.

Source

pub fn iter_names(&self) -> IterNames<Borders>

Yield a set of contained named flags values.

This method is like iter, except only yields bits in contained named flags. Any unknown bits, or bits not corresponding to a contained flag will not be yielded.

Trait Implementations§

Source§

impl Border for RoundedDashedBorder

Source§

fn get_borders(&self) -> Borders

Returns the border configuration.
Source§

fn get_border_set(&self) -> BorderSet

Returns the character set used for rendering.
Source§

fn render_left(&self, area: Rect, buffer: &mut Buffer, symbol: char)

Renders the left border.
Source§

fn render_top(&self, area: Rect, buffer: &mut Buffer, symbol: char)

Renders the top border.
Source§

fn render_right(&self, area: Rect, buffer: &mut Buffer, symbol: char)

Renders the right border.
Source§

fn render_bottom(&self, area: Rect, buffer: &mut Buffer, symbol: char)

Renders the bottom border.
Source§

fn render_corners(&self, area: Rect, buffer: &mut Buffer, charset: &BorderSet)

Renders the corner characters if adjacent sides are present.
Source§

impl Clone for RoundedDashedBorder

Source§

fn clone(&self) -> RoundedDashedBorder

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for RoundedDashedBorder

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Default for RoundedDashedBorder

Source§

fn default() -> Self

Creates a border with all sides enabled.

Source§

impl Deref for RoundedDashedBorder

Source§

type Target = Borders

The resulting type after dereferencing.
Source§

fn deref(&self) -> &Self::Target

Dereferences the value.
Source§

impl DerefMut for RoundedDashedBorder

Source§

fn deref_mut(&mut self) -> &mut Self::Target

Mutably dereferences the value.
Source§

impl<'a, W> Extend<RoundedDashedBorder> for GarnishedStatefulWidget<'a, W>

Source§

fn extend<A: IntoIterator<Item = RoundedDashedBorder>>(&mut self, iter: A)

Extends a collection with the contents of an iterator. Read more
Source§

fn extend_one(&mut self, item: A)

🔬This is a nightly-only experimental API. (extend_one)
Extends a collection with exactly one element.
Source§

fn extend_reserve(&mut self, additional: usize)

🔬This is a nightly-only experimental API. (extend_one)
Reserves capacity in a collection for the given number of additional elements. Read more
Source§

impl<'a, W> Extend<RoundedDashedBorder> for GarnishedWidget<'a, W>

Source§

fn extend<A: IntoIterator<Item = RoundedDashedBorder>>(&mut self, iter: A)

Extends a collection with the contents of an iterator. Read more
Source§

fn extend_one(&mut self, item: A)

🔬This is a nightly-only experimental API. (extend_one)
Extends a collection with exactly one element.
Source§

fn extend_reserve(&mut self, additional: usize)

🔬This is a nightly-only experimental API. (extend_one)
Reserves capacity in a collection for the given number of additional elements. Read more
Source§

impl<'a> Extend<RoundedDashedBorder> for Garnishes<'a>

Source§

fn extend<A: IntoIterator<Item = RoundedDashedBorder>>(&mut self, iter: A)

Extends a collection with the contents of an iterator. Read more
Source§

fn extend_one(&mut self, item: A)

🔬This is a nightly-only experimental API. (extend_one)
Extends a collection with exactly one element.
Source§

fn extend_reserve(&mut self, additional: usize)

🔬This is a nightly-only experimental API. (extend_one)
Reserves capacity in a collection for the given number of additional elements. Read more
Source§

impl<'a> From<RoundedDashedBorder> for Garnish<'a>

Source§

fn from(value: RoundedDashedBorder) -> Self

Converts to this type from the input type.
Source§

impl Hash for RoundedDashedBorder

Source§

fn hash<__H: Hasher>(&self, state: &mut __H)

Feeds this value into the given Hasher. Read more
1.3.0 · Source§

fn hash_slice<H>(data: &[Self], state: &mut H)
where H: Hasher, Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
Source§

impl PartialEq for RoundedDashedBorder

Source§

fn eq(&self, other: &RoundedDashedBorder) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl Copy for RoundedDashedBorder

Source§

impl Eq for RoundedDashedBorder

Source§

impl StructuralPartialEq for RoundedDashedBorder

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

Source§

fn equivalent(&self, key: &K) -> bool

Compare self to key and return true if they are equal.
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self>

Converts 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 more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

Converts 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
Source§

impl<P, T> Receiver for P
where P: Deref<Target = T> + ?Sized, T: ?Sized,

Source§

type Target = T

🔬This is a nightly-only experimental API. (arbitrary_self_types)
The target type on which the method may be called.
Source§

impl<T> RenderModifier for T
where T: Border,

Source§

fn before_render(&self, area: Rect, buffer: &mut Buffer)

Executes before the widget is rendered. Read more
Source§

fn modify_area(&self, area: Rect) -> Rect

Modifies the widget’s rendering area. Read more
Source§

fn after_render(&self, _area: Rect, _buf: &mut Buffer)

Executes after the widget is rendered. Read more
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.