[−][src]Struct termimad::CompoundStyle
A style which may be applied to a compound
Fields
object_style: ContentStyle
Methods
impl CompoundStyle
[src]
pub fn apply_to<D: Display>(&self, val: D) -> StyledContent<D> where
D: Clone,
[src]
D: Clone,
Apply an StyledContent
to the passed displayable object.
pub fn new(
foreground_color: Option<Color>,
background_color: Option<Color>,
attributes: Vec<Attribute>
) -> CompoundStyle
[src]
foreground_color: Option<Color>,
background_color: Option<Color>,
attributes: Vec<Attribute>
) -> CompoundStyle
Get an new instance of CompoundStyle
pub fn with_fgbg(fg: Color, bg: Color) -> CompoundStyle
[src]
Get an new instance of CompoundStyle
pub fn with_fg(fg: Color) -> CompoundStyle
[src]
Get an new instance of CompoundStyle
pub fn with_bg(bg: Color) -> CompoundStyle
[src]
Get an new instance of CompoundStyle
pub fn with_attr(attr: Attribute) -> CompoundStyle
[src]
Get an new instance of CompoundStyle
pub fn set_fg(&mut self, color: Color)
[src]
Set the foreground color to the passed color.
pub fn set_bg(&mut self, color: Color)
[src]
Set the background color to the passed color.
pub fn set_fgbg(&mut self, fg: Color, bg: Color)
[src]
Set the colors to the passed ones
pub fn add_attr(&mut self, attr: Attribute)
[src]
Add an Attribute
. Like italic, underlined or bold.
pub fn overwrite_with(&mut self, other: &CompoundStyle)
[src]
Add the defined characteristics of other
to self, overwriting
its own one when defined
pub fn get_fg(&self) -> Option<Color>
[src]
pub fn get_bg(&self) -> Option<Color>
[src]
pub fn repeat_string(&self, f: &mut Formatter, s: &str, count: usize) -> Result
[src]
Write a string several times with the line compound style
Implementation Note: performances here are critical
pub fn repeat_space(&self, f: &mut Formatter, count: usize) -> Result
[src]
Write 0 or more spaces with the line's compound style
pub fn queue<W, D>(&self, w: &mut W, val: D) -> Result<()> where
D: Clone + Display,
W: Write,
[src]
D: Clone + Display,
W: Write,
write the value with this style on the given writer
pub fn queue_str<W>(&self, w: &mut W, s: &str) -> Result<()> where
W: Write,
[src]
W: Write,
write the string with this style on the given writer
pub fn queue_fg<W>(&self, w: &mut W) -> Result<()> where
W: Write,
[src]
W: Write,
pub fn queue_bg<W>(&self, w: &mut W) -> Result<()> where
W: Write,
[src]
W: Write,
pub fn style_char(&self, nude_char: char) -> StyledChar
[src]
Trait Implementations
impl From<ContentStyle> for CompoundStyle
[src]
fn from(object_style: ContentStyle) -> CompoundStyle
[src]
impl Clone for CompoundStyle
[src]
fn clone(&self) -> CompoundStyle
[src]
fn clone_from(&mut self, source: &Self)
1.0.0[src]
impl Default for CompoundStyle
[src]
fn default() -> CompoundStyle
[src]
Auto Trait Implementations
impl Send for CompoundStyle
impl Sync for CompoundStyle
impl Unpin for CompoundStyle
impl UnwindSafe for CompoundStyle
impl RefUnwindSafe for CompoundStyle
Blanket Implementations
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> From<T> for T
[src]
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
fn to_owned(&self) -> T
[src]
fn clone_into(&self, target: &mut T)
[src]
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.
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>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,