pub struct RatatuiLogo { /* private fields */ }
Expand description
A widget that renders the Ratatui logo
The Ratatui logo takes up two lines of text and comes in two sizes: Tiny
and Small
. This may
be used in an application’s help or about screen to show that it is powered by Ratatui.
§Examples
The Ratatui-logo example demonstrates how to use the RatatuiLogo
widget. This can be run by
cloning the Ratatui repository and then running the following command with an optional size
argument:
cargo run --example ratatui-logo [size]
§Tiny (default, 2x15 characters)
use ratatui::widgets::RatatuiLogo;
frame.render_widget(RatatuiLogo::tiny(), frame.area());
Renders:
▛▚▗▀▖▜▘▞▚▝▛▐ ▌▌
▛▚▐▀▌▐ ▛▜ ▌▝▄▘▌
§Small (2x27 characters)
use ratatui::widgets::RatatuiLogo;
frame.render_widget(RatatuiLogo::small(), frame.area());
Renders:
█▀▀▄ ▄▀▀▄▝▜▛▘▄▀▀▄▝▜▛▘█ █ █
█▀▀▄ █▀▀█ ▐▌ █▀▀█ ▐▌ ▀▄▄▀ █
Implementations§
Source§impl RatatuiLogo
impl RatatuiLogo
Sourcepub const fn new(size: Size) -> Self
pub const fn new(size: Size) -> Self
Create a new Ratatui logo widget
§Examples
use ratatui::widgets::{RatatuiLogo, RatatuiLogoSize};
let logo = RatatuiLogo::new(RatatuiLogoSize::Tiny);
Sourcepub const fn size(self, size: Size) -> Self
pub const fn size(self, size: Size) -> Self
Set the size of the logo
§Examples
use ratatui::widgets::{RatatuiLogo, RatatuiLogoSize};
let logo = RatatuiLogo::default().size(RatatuiLogoSize::Small);
Trait Implementations§
Source§impl Clone for RatatuiLogo
impl Clone for RatatuiLogo
Source§fn clone(&self) -> RatatuiLogo
fn clone(&self) -> RatatuiLogo
Returns a copy of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreSource§impl Debug for RatatuiLogo
impl Debug for RatatuiLogo
Source§impl Default for RatatuiLogo
impl Default for RatatuiLogo
Source§fn default() -> RatatuiLogo
fn default() -> RatatuiLogo
Returns the “default value” for a type. Read more
Source§impl PartialEq for RatatuiLogo
impl PartialEq for RatatuiLogo
Source§impl Widget for RatatuiLogo
impl Widget for RatatuiLogo
impl Copy for RatatuiLogo
impl Eq for RatatuiLogo
impl StructuralPartialEq for RatatuiLogo
Auto Trait Implementations§
impl Freeze for RatatuiLogo
impl RefUnwindSafe for RatatuiLogo
impl Send for RatatuiLogo
impl Sync for RatatuiLogo
impl Unpin for RatatuiLogo
impl UnwindSafe for RatatuiLogo
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.Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
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 moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
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