Struct tabled::settings::formatting::Charset
source · pub struct Charset;
Available on crate feature
std
only.Expand description
A structure to handle special chars.
Implementations§
source§impl Charset
impl Charset
sourcepub fn clean() -> CleanCharset
pub fn clean() -> CleanCharset
Returns CleanCharset
which removes all \t
and \r
occurences.
Notice that tab is just removed rather then being replaced with spaces.
You might be better call TabSize
first if you not expect such behavior.
Example
use tabled::{Table, settings::formatting::Charset};
let text = "Some\ttext\t\twith \\tabs";
let mut table = Table::new([text]);
table.with(Charset::clean());
assert_eq!(
table.to_string(),
"+--------------------+\n\
| &str |\n\
+--------------------+\n\
| Sometextwith \\tabs |\n\
+--------------------+"
)
Trait Implementations§
source§impl Ord for Charset
impl Ord for Charset
source§impl PartialEq for Charset
impl PartialEq for Charset
source§impl PartialOrd for Charset
impl PartialOrd for Charset
1.0.0 · source§fn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
This method tests less than or equal to (for
self
and other
) and is used by the <=
operator. Read moreimpl Copy for Charset
impl Eq for Charset
impl StructuralEq for Charset
impl StructuralPartialEq for Charset
Auto Trait Implementations§
impl RefUnwindSafe for Charset
impl Send for Charset
impl Sync for Charset
impl Unpin for Charset
impl UnwindSafe for Charset
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