Struct pretty_exec::log::syntax_highlight::ansi_term::AnsiGenericString
[−]pub struct AnsiGenericString<'a, S>where
S: 'a + ToOwned + ?Sized,
<S as ToOwned>::Owned: Debug,{ /* private fields */ }Expand description
An AnsiGenericString includes a generic string type and a Style to
display that string. AnsiString and AnsiByteString are aliases for
this type on str and \[u8], respectively.
Implementations
impl<'a, S> AnsiGenericString<'a, S>where
S: 'a + ToOwned + ?Sized,
<S as ToOwned>::Owned: Debug,
impl<'a, S> AnsiGenericString<'a, S>where
S: 'a + ToOwned + ?Sized,
<S as ToOwned>::Owned: Debug,
pub fn style_ref_mut(&mut self) -> &mut Style
pub fn style_ref_mut(&mut self) -> &mut Style
Directly access the style mutably
Trait Implementations
impl<'a, S> Clone for AnsiGenericString<'a, S>where
S: 'a + ToOwned + ?Sized,
<S as ToOwned>::Owned: Debug,
impl<'a, S> Clone for AnsiGenericString<'a, S>where
S: 'a + ToOwned + ?Sized,
<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);fn clone(&self) -> AnsiGenericString<'a, S>
fn clone(&self) -> AnsiGenericString<'a, S>
Returns a copy of the value. Read more
1.0.0 · sourceconst fn clone_from(&mut self, source: &Self)
const fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreimpl<'a, S> Debug for AnsiGenericString<'a, S>where
S: 'a + Debug + ToOwned + ?Sized,
<S as ToOwned>::Owned: Debug,
impl<'a, S> Debug for AnsiGenericString<'a, S>where
S: 'a + Debug + ToOwned + ?Sized,
<S as ToOwned>::Owned: Debug,
impl<'a> Display for AnsiGenericString<'a, str>
impl<'a> Display for AnsiGenericString<'a, str>
impl<'a, I, S> From<I> for AnsiGenericString<'a, S>where
S: 'a + ToOwned + ?Sized,
I: Into<Cow<'a, S>>,
<S as ToOwned>::Owned: Debug,
impl<'a, I, S> From<I> for AnsiGenericString<'a, S>where
S: 'a + ToOwned + ?Sized,
I: Into<Cow<'a, S>>,
<S as ToOwned>::Owned: Debug,
fn from(input: I) -> AnsiGenericString<'a, S>
fn from(input: I) -> AnsiGenericString<'a, S>
Converts to this type from the input type.
impl<'a, S> PartialEq<AnsiGenericString<'a, S>> for AnsiGenericString<'a, S>where
S: 'a + PartialEq<S> + ToOwned + ?Sized,
<S as ToOwned>::Owned: Debug,
impl<'a, S> PartialEq<AnsiGenericString<'a, S>> for AnsiGenericString<'a, S>where
S: 'a + PartialEq<S> + ToOwned + ?Sized,
<S as ToOwned>::Owned: Debug,
fn eq(&self, other: &AnsiGenericString<'a, S>) -> bool
fn eq(&self, other: &AnsiGenericString<'a, S>) -> bool
impl<'a, S> StructuralPartialEq for AnsiGenericString<'a, S>where
S: 'a + ToOwned + ?Sized,
<S as ToOwned>::Owned: Debug,
Auto Trait Implementations
impl<'a, S: ?Sized> RefUnwindSafe for AnsiGenericString<'a, S>where
S: RefUnwindSafe,
<S as ToOwned>::Owned: RefUnwindSafe,
impl<'a, S: ?Sized> Send for AnsiGenericString<'a, S>where
S: Sync,
<S as ToOwned>::Owned: Send,
impl<'a, S: ?Sized> Sync for AnsiGenericString<'a, S>where
S: Sync,
<S as ToOwned>::Owned: Sync,
impl<'a, S: ?Sized> Unpin for AnsiGenericString<'a, S>where
<S as ToOwned>::Owned: Unpin,
impl<'a, S: ?Sized> UnwindSafe for AnsiGenericString<'a, S>where
S: RefUnwindSafe,
<S as ToOwned>::Owned: UnwindSafe,
Blanket Implementations
sourceimpl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
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
impl<X> Pipe for X
impl<X> Pipe for X
fn pipe_ref<'a, Return, Function>(&'a self, f: Function) -> Returnwhere
Function: FnOnce(&'a Self) -> Return,
fn pipe_ref<'a, Return, Function>(&'a self, f: Function) -> Returnwhere
Function: FnOnce(&'a Self) -> Return,
fn pipe_mut<'a, Return, Function>(&'a mut self, f: Function) -> Returnwhere
Function: FnOnce(&'a mut Self) -> Return,
fn pipe_mut<'a, Return, Function>(&'a mut self, f: Function) -> Returnwhere
Function: FnOnce(&'a mut Self) -> Return,
fn pipe_as_ref<'a, Param, Return, Function>(&'a self, f: Function) -> Returnwhere
Self: AsRef<Param>,
Param: 'a + ?Sized,
Function: FnOnce(&'a Param) -> Return,
fn pipe_as_ref<'a, Param, Return, Function>(&'a self, f: Function) -> Returnwhere
Self: AsRef<Param>,
Param: 'a + ?Sized,
Function: FnOnce(&'a Param) -> Return,
Apply
f to &self where f takes a single parameter of type Param
and Self implements trait AsRef<Param>. Read morefn pipe_as_mut<'a, Param, Return, Function>(&'a mut self, f: Function) -> Returnwhere
Self: AsMut<Param>,
Param: 'a + ?Sized,
Function: FnOnce(&'a mut Param) -> Return,
fn pipe_as_mut<'a, Param, Return, Function>(&'a mut self, f: Function) -> Returnwhere
Self: AsMut<Param>,
Param: 'a + ?Sized,
Function: FnOnce(&'a mut Param) -> Return,
Apply
f to &mut self where f takes a single parameter of type Param
and Self implements trait AsMut<Param>. Read morefn pipe_deref<'a, Param, Return, Function>(&'a self, f: Function) -> Returnwhere
Self: Deref<Target = Param>,
Param: 'a + ?Sized,
Function: FnOnce(&'a Param) -> Return,
fn pipe_deref<'a, Param, Return, Function>(&'a self, f: Function) -> Returnwhere
Self: Deref<Target = Param>,
Param: 'a + ?Sized,
Function: FnOnce(&'a Param) -> Return,
Apply
f to &self where f takes a single parameter of type Param
and Self implements trait Deref<Target = Param>. Read morefn pipe_deref_mut<'a, Param, Return, Function>(
&'a mut self,
f: Function
) -> Returnwhere
Self: DerefMut<Target = Param>,
Param: 'a + ?Sized,
Function: FnOnce(&'a mut Param) -> Return,
fn pipe_deref_mut<'a, Param, Return, Function>(
&'a mut self,
f: Function
) -> Returnwhere
Self: DerefMut<Target = Param>,
Param: 'a + ?Sized,
Function: FnOnce(&'a mut Param) -> Return,
Apply
f to &mut self where f takes a single parameter of type Param
and Self implements trait [DerefMut<Target = Param>]. Read morefn pipe_borrow<'a, Param, Return, Function>(&'a self, f: Function) -> Returnwhere
Self: Borrow<Param>,
Param: 'a + ?Sized,
Function: FnOnce(&'a Param) -> Return,
fn pipe_borrow<'a, Param, Return, Function>(&'a self, f: Function) -> Returnwhere
Self: Borrow<Param>,
Param: 'a + ?Sized,
Function: FnOnce(&'a Param) -> Return,
Apply
f to &self where f takes a single parameter of type Param
and Self implements trait Borrow<Param>. Read morefn pipe_borrow_mut<'a, Param, Return, Function>(
&'a mut self,
f: Function
) -> Returnwhere
Self: BorrowMut<Param>,
Param: 'a + ?Sized,
Function: FnOnce(&'a mut Param) -> Return,
fn pipe_borrow_mut<'a, Param, Return, Function>(
&'a mut self,
f: Function
) -> Returnwhere
Self: BorrowMut<Param>,
Param: 'a + ?Sized,
Function: FnOnce(&'a mut Param) -> Return,
Apply
f to &mut self where f takes a single parameter of type Param
and Self implements trait BorrowMut<Param>. Read more