Struct cargo_lambda_interactive::ui::Styled  
source · [−]pub struct Styled<T> where
    T: Display, {
    pub content: T,
    pub style: StyleSheet,
}Expand description
Represents a content that when rendered must have the associated style applied to it.
Fields
content: TContent to be rendered.
style: StyleSheetStyle sheet to be applied to content when rendered.
Implementations
sourceimpl<T> Styled<T> where
    T: Display, 
 
impl<T> Styled<T> where
    T: Display, 
sourcepub fn new(content: T) -> Styled<T>
 
pub fn new(content: T) -> Styled<T>
Creates a new Styled object with the specified content
and a default (empty) style sheet.
sourcepub fn with_style_sheet(self, style_sheet: StyleSheet) -> Styled<T>
 
pub fn with_style_sheet(self, style_sheet: StyleSheet) -> Styled<T>
Sets the style sheet to the styled struct.
sourcepub fn with_fg(self, fg: Color) -> Styled<T>
 
pub fn with_fg(self, fg: Color) -> Styled<T>
Sets the styled content to have the defined foreground Color.
sourcepub fn with_bg(self, bg: Color) -> Styled<T>
 
pub fn with_bg(self, bg: Color) -> Styled<T>
Sets the styled content to have the defined foreground Color.
sourcepub fn with_attr(self, attributes: Attributes) -> Styled<T>
 
pub fn with_attr(self, attributes: Attributes) -> Styled<T>
Sets the styled content to have the defined attributes.
Warning: this does not keep the previously applied attributes. If you want to just set a new attribute and keep the others, you need to apply the OR operation yourself.
Trait Implementations
impl<T> Copy for Styled<T> where
    T: Copy + Display, 
Auto Trait Implementations
impl<T> RefUnwindSafe for Styled<T> where
    T: RefUnwindSafe, 
impl<T> Send for Styled<T> where
    T: Send, 
impl<T> Sync for Styled<T> where
    T: Sync, 
impl<T> Unpin for Styled<T> where
    T: Unpin, 
impl<T> UnwindSafe for Styled<T> where
    T: UnwindSafe, 
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
    T: ?Sized, 
 
impl<T> BorrowMut<T> for T where
    T: ?Sized, 
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
 
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more