[−][src]Struct terminal_color_builder::OutputFormatter
Implementations
impl OutputFormatter
[src]
This struct is used to create the builder for CLI-colors the following example creates a string "hi", that has white (as hex-color) foreground and green background
Example
use terminal_color_builder::*; let str = OutputFormatter::new().fg().hex("#fff").bg().green().text("Hi".to_string()).print();
pub fn new() -> Self
[src]
pub fn fg(self) -> OutputColor
[src]
Set the current context to foreground
pub fn bg(self) -> OutputColor
[src]
Set the current context to foreground
pub fn custom(self, fg: COLORS, bg: COLORS) -> OutputFormatter
[src]
apply custom color with the COLORS-enum
Example
use terminal_color_builder::*; use terminal_color_builder::color::COLORS; let c = OutputFormatter::new().custom(COLORS::White, COLORS::Green).text("Hi".to_string());
pub fn text(self, message: String) -> Self
[src]
add text to apply color for
pub fn text_str(self, message: &str) -> Self
[src]
add text as str to apply color for
pub fn print(&self) -> String
[src]
render the builder into a string
Auto Trait Implementations
impl RefUnwindSafe for OutputFormatter
impl Send for OutputFormatter
impl Sync for OutputFormatter
impl Unpin for OutputFormatter
impl UnwindSafe for OutputFormatter
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,