pub struct BoxChars {
pub top_left: Cow<'static, str>,
pub top: Cow<'static, str>,
pub top_right: Cow<'static, str>,
pub right: Cow<'static, str>,
pub bottom_right: Cow<'static, str>,
pub bottom: Cow<'static, str>,
pub bottom_left: Cow<'static, str>,
pub left: Cow<'static, str>,
}Expand description
All eight box-drawing characters for one border style.
Uses Cow<'static, str> so named-style constants are zero-copy (Borrowed)
while Custom border styles use Owned strings without leaking memory.
Fields§
§top_left: Cow<'static, str>§top: Cow<'static, str>§top_right: Cow<'static, str>§right: Cow<'static, str>§bottom_right: Cow<'static, str>§bottom: Cow<'static, str>§bottom_left: Cow<'static, str>§left: Cow<'static, str>Implementations§
Source§impl BoxChars
impl BoxChars
Sourcepub fn from_custom(c: CustomChars) -> Self
pub fn from_custom(c: CustomChars) -> Self
Build from a CustomChars (for BorderStyle::Custom).
No leaking: the strings are moved into Cow::Owned and freed when the
BoxChars value is dropped at the end of each render_border call.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for BoxChars
impl RefUnwindSafe for BoxChars
impl Send for BoxChars
impl Sync for BoxChars
impl Unpin for BoxChars
impl UnsafeUnpin for BoxChars
impl UnwindSafe for BoxChars
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