pub struct Dup<Dst, Src> { /* private fields */ }
Available on crate feature
std
only.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::single(1), Rows::single(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: PartialEq, Src: PartialEq> PartialEq for Dup<Dst, Src>
impl<Dst: PartialEq, Src: PartialEq> PartialEq for Dup<Dst, Src>
source§impl<Dst: PartialOrd, Src: PartialOrd> PartialOrd for Dup<Dst, Src>
impl<Dst: PartialOrd, Src: PartialOrd> PartialOrd for Dup<Dst, Src>
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 moresource§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> StructuralEq for Dup<Dst, Src>
impl<Dst, Src> StructuralPartialEq for Dup<Dst, Src>
Auto Trait Implementations§
impl<Dst, Src> RefUnwindSafe for Dup<Dst, Src>where
Dst: RefUnwindSafe,
Src: 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
Dst: UnwindSafe,
Src: 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