Skip to main content

ThemeIcons

Struct ThemeIcons 

Source
pub struct ThemeIcons {
Show 15 fields pub success: &'static str, pub failure: &'static str, pub warning: &'static str, pub info: &'static str, pub arrow_right: &'static str, pub arrow_left: &'static str, pub bullet: &'static str, pub lock: &'static str, pub unlock: &'static str, pub http: &'static str, pub loading: &'static str, pub route: &'static str, pub database: &'static str, pub time: &'static str, pub size: &'static str,
}
Expand description

Icons used throughout the theme for visual feedback.

Provides both Unicode icons and ASCII fallbacks for terminals that don’t support extended Unicode characters.

§Example

use fastapi_output::themes::ThemeIcons;

let icons = ThemeIcons::unicode();
println!("{} Success!", icons.success);

// For older terminals
let ascii = ThemeIcons::ascii();
println!("{} Success!", ascii.success);

Fields§

§success: &'static str

Success indicator (e.g., checkmark).

§failure: &'static str

Failure/error indicator (e.g., X).

§warning: &'static str

Warning indicator.

§info: &'static str

Info indicator.

§arrow_right: &'static str

Right arrow for flow indication.

§arrow_left: &'static str

Left arrow.

§bullet: &'static str

Bullet point.

§lock: &'static str

Lock/security indicator.

§unlock: &'static str

Unlock indicator.

§http: &'static str

HTTP indicator.

§loading: &'static str

Loading/in-progress indicator.

§route: &'static str

Route/path indicator.

§database: &'static str

Database/storage indicator.

§time: &'static str

Time/clock indicator.

§size: &'static str

Size/memory indicator.

Implementations§

Source§

impl ThemeIcons

Source

pub const fn unicode() -> Self

Create icons using Unicode characters.

Recommended for modern terminals with good Unicode support.

Source

pub const fn ascii() -> Self

Create icons using ASCII-only characters.

Use for terminals without Unicode support or when consistent character widths are required.

Source

pub const fn compact() -> Self

Create compact Unicode icons (single-width preferred).

Uses single-width Unicode where possible for better alignment.

Source

pub fn auto() -> Self

Auto-detect based on environment.

Returns ASCII icons if TERM is “dumb” or if running in a known agent environment that prefers plain text.

Trait Implementations§

Source§

impl Clone for ThemeIcons

Source§

fn clone(&self) -> ThemeIcons

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 ThemeIcons

Source§

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

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

impl Default for ThemeIcons

Source§

fn default() -> Self

Returns the “default value” for a type. Read more
Source§

impl PartialEq for ThemeIcons

Source§

fn eq(&self, other: &ThemeIcons) -> 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 Eq for ThemeIcons

Source§

impl StructuralPartialEq for ThemeIcons

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<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> 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.