Skip to main content

Row

Trait Row 

Source
pub trait Row {
    // Required methods
    fn cell(&self, col_index: usize) -> Option<TableCell<'_>>;
    fn column_count(&self) -> usize;

    // Provided methods
    fn row_index(&self) -> Option<usize> { ... }
    fn to_owned_row(&self) -> OwnedRow { ... }
}
Expand description

A row element that resolves display text properties at specific column offsets.

Required Methods§

Source

fn cell(&self, col_index: usize) -> Option<TableCell<'_>>

Source

fn column_count(&self) -> usize

Provided Methods§

Source

fn row_index(&self) -> Option<usize>

Returns the physical index of this row within the provider, if available.

Source

fn to_owned_row(&self) -> OwnedRow

Snapshots every column of this row into an OwnedRow, detaching it from the provider’s borrow lifetime so it can be cached.

Trait Implementations§

Source§

impl RowSliceExt for dyn Row + '_

Source§

fn get_primary(&self, col_index: usize) -> Result<Cow<'_, str>, TableError>

Extracts the primary text at the specified column index.
Source§

fn get_hover(&self, col_index: usize) -> Result<Cow<'_, str>, TableError>

Extracts the hover/alternate text at the specified column index.
Source§

fn parse_primary<T>(&self, col_index: usize) -> Result<T, TableError>
where T: FromStr, <T as FromStr>::Err: Display,

Parses the primary text at the specified column index into type T.
Source§

fn parse_hover<T>(&self, col_index: usize) -> Result<T, TableError>
where T: FromStr, <T as FromStr>::Err: Display,

Parses the hover text at the specified column index into type T.

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementations on Foreign Types§

Source§

impl Row for [TableCell<'_>]

Source§

fn cell(&self, col_index: usize) -> Option<TableCell<'_>>

Source§

fn column_count(&self) -> usize

Implementors§