pub struct Dup<Dst, Src> { /* private fields */ }
Expand description
Dup
duplicates a given set of cells into another set of ones Table
.
§Example
use tabled::{Table, settings::{object::Rows, Dup}};
let data = [
["1", "2", "3"],
["Some\nMulti\nLine\nText", "and a line", "here"],
["4", "5", "6"],
];
let mut table = Table::new(&data);
table.with(Dup::new(Rows::one(1), Rows::one(2)));
assert_eq!(
table.to_string(),
"+-------+------------+------+\n\
| 0 | 1 | 2 |\n\
+-------+------------+------+\n\
| Some | and a line | here |\n\
| Multi | | |\n\
| Line | | |\n\
| Text | | |\n\
+-------+------------+------+\n\
| Some | and a line | here |\n\
| Multi | | |\n\
| Line | | |\n\
| Text | | |\n\
+-------+------------+------+\n\
| 4 | 5 | 6 |\n\
+-------+------------+------+",
)
Implementations§
Trait Implementations§
Source§impl<Dst: Ord, Src: Ord> Ord for Dup<Dst, Src>
impl<Dst: Ord, Src: Ord> Ord for Dup<Dst, Src>
1.21.0 · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the maximum of two values. Read more
Source§impl<Dst: PartialOrd, Src: PartialOrd> PartialOrd for Dup<Dst, Src>
impl<Dst: PartialOrd, Src: PartialOrd> PartialOrd for Dup<Dst, Src>
Source§impl<Dst, Src, R, D, C> TableOption<R, C, D> for Dup<Dst, Src>where
Dst: Object<R>,
Src: Object<R>,
R: Records + ExactRecords + PeekableRecords + RecordsMut<String>,
impl<Dst, Src, R, D, C> TableOption<R, C, D> for Dup<Dst, Src>where
Dst: Object<R>,
Src: Object<R>,
R: Records + ExactRecords + PeekableRecords + RecordsMut<String>,
impl<Dst: Copy, Src: Copy> Copy for Dup<Dst, Src>
impl<Dst: Eq, Src: Eq> Eq for Dup<Dst, Src>
impl<Dst, Src> StructuralPartialEq for Dup<Dst, Src>
Auto Trait Implementations§
impl<Dst, Src> Freeze for Dup<Dst, Src>
impl<Dst, Src> RefUnwindSafe for Dup<Dst, Src>where
Src: RefUnwindSafe,
Dst: RefUnwindSafe,
impl<Dst, Src> Send for Dup<Dst, Src>
impl<Dst, Src> Sync for Dup<Dst, Src>
impl<Dst, Src> Unpin for Dup<Dst, Src>
impl<Dst, Src> UnwindSafe for Dup<Dst, Src>where
Src: UnwindSafe,
Dst: UnwindSafe,
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