Row

Trait Row 

Source
pub trait Row:
    PartialEq
    + Clone
    + 'static {
    // Required method
    fn key(&self) -> impl Into<String>;
}
Expand description

Defines the unique key and identity of each table row.

This trait must be implemented for any type you want to use as a row in a table. The key is used by Dioxus for efficient rendering and should uniquely identify each row.

§Example

use dioxus_tabular::Row;

#[derive(Clone, PartialEq)]
struct User {
    id: u32,
    name: String,
}

impl Row for User {
    fn key(&self) -> impl Into<String> {
        self.id.to_string()
    }
}

Required Methods§

Source

fn key(&self) -> impl Into<String>

Returns a unique key for this row.

The key must be unique within the table and stable across re-renders.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§