Type Alias nu_ansi_term::AnsiByteString

source ·
pub type AnsiByteString<'a> = AnsiGenericString<'a, [u8]>;
Expand description

An AnsiByteString represents a formatted series of bytes. Use AnsiByteString when styling text with an unknown encoding.

Aliased Type§

struct AnsiByteString<'a> { /* private fields */ }

Implementations§

source§

impl<'a> AnsiByteString<'a>

source

pub fn write_to<W: Write>(&self, w: &mut W) -> Result<()>

Write an AnsiByteString to an io::Write. This writes the escape sequences for the associated Style around the bytes.

source§

impl<'a, S: 'a + ToOwned + ?Sized> AnsiGenericString<'a, S>
where <S as ToOwned>::Owned: Debug,

source

pub fn style_ref(&self) -> &Style

Directly access the style

source

pub fn style_ref_mut(&mut self) -> &mut Style

Directly access the style mutably

Trait Implementations

source§

impl<'a, S: 'a + ToOwned + ?Sized> Clone for AnsiGenericString<'a, S>
where <S as ToOwned>::Owned: Debug,

Cloning an AnsiGenericString will clone its underlying string.

§Examples

use nu_ansi_term::AnsiString;

let plain_string = AnsiString::from("a plain string");
let clone_string = plain_string.clone();
assert_eq!(clone_string, plain_string);
source§

fn clone(&self) -> AnsiGenericString<'a, S>

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl<'a, S: Debug + 'a + ToOwned + ?Sized> Debug for AnsiGenericString<'a, S>
where <S as ToOwned>::Owned: Debug,

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl<'a, I, S: 'a + ToOwned + ?Sized> From<I> for AnsiGenericString<'a, S>
where I: Into<Cow<'a, S>>, <S as ToOwned>::Owned: Debug,

source§

fn from(input: I) -> AnsiGenericString<'a, S>

Converts to this type from the input type.
source§

impl<'a, S: PartialEq + 'a + ToOwned + ?Sized> PartialEq for AnsiGenericString<'a, S>
where <S as ToOwned>::Owned: Debug,

source§

fn eq(&self, other: &AnsiGenericString<'a, S>) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
source§

impl<'a, S: 'a + ToOwned + ?Sized> StructuralPartialEq for AnsiGenericString<'a, S>
where <S as ToOwned>::Owned: Debug,