Struct nu_ansi_term::AnsiGenericString
source · pub struct AnsiGenericString<'a, S: 'a + ToOwned + ?Sized>{ /* 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§
source§impl<'a, S: 'a + ToOwned + ?Sized> AnsiGenericString<'a, S>
impl<'a, S: 'a + ToOwned + ?Sized> AnsiGenericString<'a, S>
Trait Implementations§
source§impl<'a, S: 'a + ToOwned + ?Sized> Clone for AnsiGenericString<'a, S>
impl<'a, S: 'a + ToOwned + ?Sized> Clone for AnsiGenericString<'a, S>
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>
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)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moresource§impl<'a, I, S: 'a + ToOwned + ?Sized> From<I> for AnsiGenericString<'a, S>
impl<'a, I, S: 'a + ToOwned + ?Sized> From<I> for AnsiGenericString<'a, S>
source§fn from(input: I) -> AnsiGenericString<'a, S>
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>
impl<'a, S: PartialEq + 'a + ToOwned + ?Sized> PartialEq for AnsiGenericString<'a, S>
source§fn eq(&self, other: &AnsiGenericString<'a, S>) -> bool
fn eq(&self, other: &AnsiGenericString<'a, S>) -> bool
This method tests for
self
and other
values to be equal, and is used
by ==
.impl<'a, S: 'a + ToOwned + ?Sized> StructuralPartialEq for AnsiGenericString<'a, S>
Auto Trait Implementations§
impl<'a, S: ?Sized> RefUnwindSafe for AnsiGenericString<'a, S>
impl<'a, S: ?Sized> Send for AnsiGenericString<'a, S>
impl<'a, S: ?Sized> Sync for AnsiGenericString<'a, S>
impl<'a, S: ?Sized> Unpin for AnsiGenericString<'a, S>
impl<'a, S: ?Sized> UnwindSafe for AnsiGenericString<'a, S>
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more