[−][src]Struct sunrise_kernel::devices::rs232::SerialAttributes
A foreground and a background combination
Fields
fg: SerialColor
foreground color
bg: SerialColor
background color
Implementations
impl SerialAttributes
[src]
pub fn fg(fg: SerialColor) -> SerialAttributes
[src]
Creates a color attribute with fg
foreground and default background.
pub fn fg_bg(fg: SerialColor, bg: SerialColor) -> SerialAttributes
[src]
Creates a color attribute with fg
foreground and bg
background.
pub fn default() -> SerialAttributes
[src]
Creates a color attribute with default foreground and default background.
Trait Implementations
impl Clone for SerialAttributes
[src]
fn clone(&self) -> SerialAttributes
[src]
fn clone_from(&mut self, source: &Self)
1.0.0[src]
impl Copy for SerialAttributes
[src]
impl Debug for SerialAttributes
[src]
impl Display for SerialAttributes
[src]
To log something with color attributes do something like this:
use ::device::rs232::{SerialLogger, SerialAttributes, SerialColor}; use ::core::fmt::Write; write!(SerialLogger, "Hello {}World{}!", SerialAttributes::fg(SerialColor::Green), // a green foreground with default background. SerialAttributes::default() // don't forget to set back to default attributes at the end. );
Auto Trait Implementations
impl RefUnwindSafe for SerialAttributes
impl Send for SerialAttributes
impl Sync for SerialAttributes
impl Unpin for SerialAttributes
impl UnwindSafe for SerialAttributes
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,
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> 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> ToString for T where
T: Display + ?Sized,
[src]
T: Display + ?Sized,
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>,