pub struct AsTable<'table, Table, RowKey, Row, CellKey>(/* private fields */)
where
RowKey: RowKey,
Row: Cells<CellKey>,
CellKey: CellKey + ?Sized;
Expand description
Transparent wrapper for interpreting data as a table.
AsTable
provides a reference-based wrapper for table-like structures,
encapsulating type information needed to interpret data as a table.
Implementations§
Trait Implementations§
Source§impl<'table, Table, RowKey, Row, CellKey> AsRef<Table> for AsTable<'table, Table, RowKey, Row, CellKey>
impl<'table, Table, RowKey, Row, CellKey> AsRef<Table> for AsTable<'table, Table, RowKey, Row, CellKey>
Source§impl<'table, Table: Clone, RowKey, Row, CellKey> Clone for AsTable<'table, Table, RowKey, Row, CellKey>
impl<'table, Table: Clone, RowKey, Row, CellKey> Clone for AsTable<'table, Table, RowKey, Row, CellKey>
Source§impl<'table, Table, RowKey, Row, CellKey> Debug for AsTable<'table, Table, RowKey, Row, CellKey>
impl<'table, Table, RowKey, Row, CellKey> Debug for AsTable<'table, Table, RowKey, Row, CellKey>
Source§impl<'table, Table, RowKey, Row, CellKey> Deref for AsTable<'table, Table, RowKey, Row, CellKey>
impl<'table, Table, RowKey, Row, CellKey> Deref for AsTable<'table, Table, RowKey, Row, CellKey>
Source§impl<'table, Table, RowKey, Row, CellKey> From<&'table Table> for AsTable<'table, Table, RowKey, Row, CellKey>
impl<'table, Table, RowKey, Row, CellKey> From<&'table Table> for AsTable<'table, Table, RowKey, Row, CellKey>
Source§fn from(table: &'table Table) -> Self
fn from(table: &'table Table) -> Self
Converts to this type from the input type.
Source§impl<'table, Table, RowKey, Row, CellKey> IntoAsTable for AsTable<'table, Table, RowKey, Row, CellKey>
impl<'table, Table, RowKey, Row, CellKey> IntoAsTable for AsTable<'table, Table, RowKey, Row, CellKey>
Source§impl<'data, T, RowKey, Row, CellKey> TableFormatter<'data> for AsTable<'data, T, RowKey, Row, CellKey>
A trait for formatting tables.
impl<'data, T, RowKey, Row, CellKey> TableFormatter<'data> for AsTable<'data, T, RowKey, Row, CellKey>
A trait for formatting tables.
Source§fn fmt<'a>(&'data self, c: &mut Context<'a>) -> Result
fn fmt<'a>(&'data self, c: &mut Context<'a>) -> Result
Formats the table and writes the result to the provided context.
Source§fn table_to_string(&'data self) -> String
fn table_to_string(&'data self) -> String
Converts the table to a string representation. Read more
Source§fn table_to_string_with_format<'context, Styles>(
&'data self,
styles: &'context Styles,
) -> Stringwhere
Styles: TableOutputFormat,
fn table_to_string_with_format<'context, Styles>(
&'data self,
styles: &'context Styles,
) -> Stringwhere
Styles: TableOutputFormat,
Converts the table to a string representation specifying printer. Read more
Source§impl<T, RowKey, Row, CellKey> TableHeader for AsTable<'_, T, RowKey, Row, CellKey>
impl<T, RowKey, Row, CellKey> TableHeader for AsTable<'_, T, RowKey, Row, CellKey>
Source§impl<T, RowKey, Row, CellKey> TableRows for AsTable<'_, T, RowKey, Row, CellKey>
impl<T, RowKey, Row, CellKey> TableRows for AsTable<'_, T, RowKey, Row, CellKey>
Source§type Row = Row
type Row = Row
The type representing a row, which must implement
Cells
for the specified CellKey
and CellRepr
.Source§type CellKey = CellKey
type CellKey = CellKey
The type used to identify cells within a row, requiring
implementation of the
Key
trait.Source§fn rows(&self) -> impl IteratorTrait<Item = &Self::Row>
fn rows(&self) -> impl IteratorTrait<Item = &Self::Row>
Returns an iterator over all rows of the table.
impl<'table, Table: Copy, RowKey, Row, CellKey> Copy for AsTable<'table, Table, RowKey, Row, CellKey>
Auto Trait Implementations§
impl<'table, Table, RowKey, Row, CellKey> Freeze for AsTable<'table, Table, RowKey, Row, CellKey>where
CellKey: ?Sized,
impl<'table, Table, RowKey, Row, CellKey> RefUnwindSafe for AsTable<'table, Table, RowKey, Row, CellKey>where
Table: RefUnwindSafe,
CellKey: ?Sized,
impl<'table, Table, RowKey, Row, CellKey> Send for AsTable<'table, Table, RowKey, Row, CellKey>
impl<'table, Table, RowKey, Row, CellKey> Sync for AsTable<'table, Table, RowKey, Row, CellKey>
impl<'table, Table, RowKey, Row, CellKey> Unpin for AsTable<'table, Table, RowKey, Row, CellKey>where
CellKey: ?Sized,
impl<'table, Table, RowKey, Row, CellKey> UnwindSafe for AsTable<'table, Table, RowKey, Row, CellKey>where
Table: RefUnwindSafe,
CellKey: ?Sized,
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<C, E> EntryToVal<C> for Ewhere
C: Collection<Entry = E>,
impl<C, E> EntryToVal<C> for Ewhere
C: Collection<Entry = E>,
Source§type Val = <C as Collection>::Val
type Val = <C as Collection>::Val
The type of values stored in the collection. This might be distinct from
Entry
in complex collections.
For example, in a HashMap
, while Entry
might be a ( key, value ) tuple, Val
might only be the value part.Source§fn entry_to_val(self) -> <E as EntryToVal<C>>::Val
fn entry_to_val(self) -> <E as EntryToVal<C>>::Val
Converts an entry into a value representation specific to the type of collection. This conversion is crucial
for handling operations on entries, especially when they need to be treated or accessed as individual values,
such as retrieving the value part from a key-value pair in a hash map.
Source§impl<'a, T> ToStringWith<WithDebug> for T
impl<'a, T> ToStringWith<WithDebug> for T
Source§fn to_string_with<'s>(&'s self) -> Cow<'s, str>
fn to_string_with<'s>(&'s self) -> Cow<'s, str>
Converts the type to a string using Debug formatting.
Source§impl<'a, T> ToStringWith<WithDebugMultiline> for T
impl<'a, T> ToStringWith<WithDebugMultiline> for T
Source§fn to_string_with<'s>(&'s self) -> Cow<'s, str>
fn to_string_with<'s>(&'s self) -> Cow<'s, str>
Converts the type to a string using Debug formatting.
Source§impl<C, Val> ValToEntry<C> for Valwhere
C: CollectionValToEntry<Val>,
impl<C, Val> ValToEntry<C> for Valwhere
C: CollectionValToEntry<Val>,
Source§fn val_to_entry(self) -> <C as CollectionValToEntry<Val>>::Entry
fn val_to_entry(self) -> <C as CollectionValToEntry<Val>>::Entry
Invokes the val_to_entry
function of the CollectionValToEntry
trait to convert the value to an entry.
Source§type Entry = <C as CollectionValToEntry<Val>>::Entry
type Entry = <C as CollectionValToEntry<Val>>::Entry
Represents the type of entry that corresponds to the value within the collection.
Type
Entry
is defined by the Collection
trait.