pub struct Charset;
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
occurrences.
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 PartialOrd for Charset
impl PartialOrd for Charset
impl Copy for Charset
impl Eq for Charset
impl StructuralPartialEq for Charset
Auto Trait Implementations§
impl Freeze for Charset
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