tabled

Struct Disable

Source
pub struct Disable<L, Target> { /* private fields */ }
Expand description

Disable removes particular rows/columns from a Table.

It tries to keeps track of style changes which may occur. But it’s not guaranteed will be the way you would expect it to be.

§Example

let table = Table::new(&data).with(Disable::row(Rows::first()));

Implementations§

Source§

impl<L> Disable<L, TargetColumn>

Source

pub fn column(locator: L) -> Self
where L: Locator<Coordinate = usize>,

Disable columns.

Available locators are:

use tabled::{Disable, locator::ByColumnName, builder::Builder, object::Columns};

let mut builder = Builder::default();

builder.add_record(["col1", "col2", "col3"]);
builder.add_record(["Hello", "World", "1"]);

let table = builder.build()
    .with(Disable::column(ByColumnName::new("col3")))
    .to_string();

assert_eq!(
    table,
    "+-------+-------+\n\
     | col1  | col2  |\n\
     +-------+-------+\n\
     | Hello | World |\n\
     +-------+-------+"
);
Source§

impl<L> Disable<L, TargetRow>

Source

pub fn row(locator: L) -> Self
where L: Locator<Coordinate = usize>,

Disable rows.

Available locators are:

use tabled::{Disable, builder::Builder, object::Rows};

let mut builder = Builder::default();

builder.add_record(["col1", "col2", "col3"]);
builder.add_record(["Hello", "World", "1"]);

let table = builder.build()
    .with(Disable::row(Rows::first()))
    .to_string();

assert_eq!(
    table,
    "+-------+-------+---+\n\
     | Hello | World | 1 |\n\
     +-------+-------+---+"
);

Trait Implementations§

Source§

impl<L: Debug, Target: Debug> Debug for Disable<L, Target>

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<L, D> TableOption<D> for Disable<L, TargetColumn>
where L: Locator<Coordinate = usize>, D: Records + Resizable,

Source§

fn change(&mut self, table: &mut Table<D>)

The function modifies a Grid object.
Source§

impl<L, D> TableOption<D> for Disable<L, TargetRow>
where L: Locator<Coordinate = usize>, D: Records + Resizable,

Source§

fn change(&mut self, table: &mut Table<D>)

The function modifies a Grid object.

Auto Trait Implementations§

§

impl<L, Target> Freeze for Disable<L, Target>
where L: Freeze,

§

impl<L, Target> RefUnwindSafe for Disable<L, Target>
where L: RefUnwindSafe, Target: RefUnwindSafe,

§

impl<L, Target> Send for Disable<L, Target>
where L: Send, Target: Send,

§

impl<L, Target> Sync for Disable<L, Target>
where L: Sync, Target: Sync,

§

impl<L, Target> Unpin for Disable<L, Target>
where L: Unpin, Target: Unpin,

§

impl<L, Target> UnwindSafe for Disable<L, Target>
where L: UnwindSafe, Target: UnwindSafe,

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.