Struct tabled::settings::formatting::CleanCharset
source · pub struct CleanCharset;
Available on crate feature
std
only.Expand description
CleanCharset
removes all \t
and \r
occurences.
Example
use std::iter::FromIterator;
use tabled::{
Table, builder::Builder,
settings::formatting::Charset,
};
let text = "Some text which was created on windows \r\n yes they use this \\r\\n";
let mut builder = Builder::from(Table::from_iter([[text]]));
builder.insert_record(0, ["win. text"]);
let mut table = builder.build();
table.with(Charset::clean());
assert_eq!(
table.to_string(),
"+-----------------------------------------+\n\
| win. text |\n\
+-----------------------------------------+\n\
| Some text which was created on windows |\n\
| yes they use this \\r\\n |\n\
+-----------------------------------------+"
)
Trait Implementations§
source§impl<R, C> CellOption<R, C> for CleanCharset
impl<R, C> CellOption<R, C> for CleanCharset
source§impl Clone for CleanCharset
impl Clone for CleanCharset
source§fn clone(&self) -> CleanCharset
fn clone(&self) -> CleanCharset
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 Debug for CleanCharset
impl Debug for CleanCharset
source§impl Default for CleanCharset
impl Default for CleanCharset
source§fn default() -> CleanCharset
fn default() -> CleanCharset
Returns the “default value” for a type. Read more
source§impl<R, D, C> TableOption<R, C, D> for CleanCharset
impl<R, D, C> TableOption<R, C, D> for CleanCharset
Auto Trait Implementations§
impl RefUnwindSafe for CleanCharset
impl Send for CleanCharset
impl Sync for CleanCharset
impl Unpin for CleanCharset
impl UnwindSafe for CleanCharset
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