Struct termimad::CompoundStyle [−][src]
pub struct CompoundStyle { pub object_style: ContentStyle, }
A style which may be applied to a compound
Fields
object_style: ContentStyle
Implementations
impl CompoundStyle
[src]
impl CompoundStyle
[src]pub fn apply_to<D>(&self, val: D) -> StyledContent<D> where
D: Clone + Display,
[src]
D: Clone + Display,
Apply an StyledContent
to the passed displayable object.
pub fn new(
foreground_color: Option<Color>,
background_color: Option<Color>,
attributes: Attributes
) -> CompoundStyle
[src]
foreground_color: Option<Color>,
background_color: Option<Color>,
attributes: Attributes
) -> 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 remove_attr(&mut self, attr: Attribute)
[src]
Remove 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]
&self,
f: &mut Formatter<'_>,
s: &str,
count: usize
) -> Result
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 clear<W>(&self, w: &mut W, clear_type: ClearType) -> Result<()> where
W: Write,
[src]
W: Write,
Clear with the compound_style’s background.
let mut w = std::io::stderr(); skin.paragraph.compound_style.clear(&mut w, ClearType::UntilNewLine).unwrap();
pub fn style_char(&self, nude_char: char) -> StyledChar
[src]
Trait Implementations
impl Clone for CompoundStyle
[src]
impl Clone for CompoundStyle
[src]fn clone(&self) -> CompoundStyle
[src]
pub fn clone_from(&mut self, source: &Self)
1.0.0[src]
impl Default for CompoundStyle
[src]
impl Default for CompoundStyle
[src]fn default() -> CompoundStyle
[src]
impl From<ContentStyle> for CompoundStyle
[src]
impl From<ContentStyle> for CompoundStyle
[src]fn from(object_style: ContentStyle) -> CompoundStyle
[src]
Auto Trait Implementations
impl RefUnwindSafe for CompoundStyle
impl RefUnwindSafe for CompoundStyle
impl Send for CompoundStyle
impl Send for CompoundStyle
impl Sync for CompoundStyle
impl Sync for CompoundStyle
impl Unpin for CompoundStyle
impl Unpin for CompoundStyle
impl UnwindSafe for CompoundStyle
impl UnwindSafe for CompoundStyle