Trait leptos_struct_table::CellValue

source ·
pub trait CellValue {
    type RenderOptions: Default;

    // Required method
    fn render_value(self, options: &Self::RenderOptions) -> impl IntoView;
}
Expand description

A value that can be rendered as part of a table, required for types if the crate::DefaultTableCellRenderer() is used

Required Associated Types§

source

type RenderOptions: Default

Formatting options for this cell value type, needs to implement default and have public named fields, the empty tuple: () is fine if no formatting options can be accepted.

Required Methods§

source

fn render_value(self, options: &Self::RenderOptions) -> impl IntoView

This is called to actually render the value. The parameter options is filled by the #[table(format(...))] macro attribute or Default::default() if omitted.

Object Safety§

This trait is not object safe.

Implementations on Foreign Types§

source§

impl CellValue for &'static str

§

type RenderOptions = ()

source§

fn render_value(self, _options: &Self::RenderOptions) -> impl IntoView

source§

impl CellValue for &String

§

type RenderOptions = ()

source§

fn render_value(self, _options: &Self::RenderOptions) -> impl IntoView

source§

impl CellValue for Cow<'static, str>

§

type RenderOptions = ()

source§

fn render_value(self, _options: &Self::RenderOptions) -> impl IntoView

source§

impl CellValue for IpAddr

§

type RenderOptions = ()

source§

fn render_value(self, _options: &Self::RenderOptions) -> impl IntoView

source§

impl CellValue for SocketAddr

§

type RenderOptions = ()

source§

fn render_value(self, _options: &Self::RenderOptions) -> impl IntoView

source§

impl CellValue for View

§

type RenderOptions = ()

source§

fn render_value(self, _options: &Self::RenderOptions) -> impl IntoView

source§

impl CellValue for bool

§

type RenderOptions = ()

source§

fn render_value(self, _options: &Self::RenderOptions) -> impl IntoView

source§

impl CellValue for char

§

type RenderOptions = ()

source§

fn render_value(self, _options: &Self::RenderOptions) -> impl IntoView

source§

impl CellValue for f32

source§

impl CellValue for f64

source§

impl CellValue for i8

source§

impl CellValue for i16

source§

impl CellValue for i32

source§

impl CellValue for i64

source§

impl CellValue for i128

source§

impl CellValue for isize

source§

impl CellValue for u8

source§

impl CellValue for u16

source§

impl CellValue for u32

source§

impl CellValue for u64

source§

impl CellValue for u128

source§

impl CellValue for usize

source§

impl CellValue for String

§

type RenderOptions = ()

source§

fn render_value(self, _options: &Self::RenderOptions) -> impl IntoView

source§

impl CellValue for ToLowercase

§

type RenderOptions = ()

source§

fn render_value(self, _options: &Self::RenderOptions) -> impl IntoView

source§

impl CellValue for ToUppercase

§

type RenderOptions = ()

source§

fn render_value(self, _options: &Self::RenderOptions) -> impl IntoView

source§

impl CellValue for Ipv4Addr

§

type RenderOptions = ()

source§

fn render_value(self, _options: &Self::RenderOptions) -> impl IntoView

source§

impl CellValue for Ipv6Addr

§

type RenderOptions = ()

source§

fn render_value(self, _options: &Self::RenderOptions) -> impl IntoView

source§

impl CellValue for SocketAddrV4

§

type RenderOptions = ()

source§

fn render_value(self, _options: &Self::RenderOptions) -> impl IntoView

source§

impl CellValue for SocketAddrV6

§

type RenderOptions = ()

source§

fn render_value(self, _options: &Self::RenderOptions) -> impl IntoView

source§

impl CellValue for Location<'_>

§

type RenderOptions = ()

source§

fn render_value(self, _options: &Self::RenderOptions) -> impl IntoView

source§

impl CellValue for NaiveDate

Implementation for NaiveDate to work with the TableRow derive and the DefaultTableCellRenderer

#[derive(TableRow, Clone)]
#[table]
struct SomeStruct {
    #[table(format(string = "%Y-%m-%d"))]
    my_field: NaiveDate
}
source§

impl CellValue for NaiveDateTime

Implementation for NaiveDateTime to work with the TableRow derive and the DefaultTableCellRenderer

#[derive(TableRow, Clone)]
#[table]
struct SomeStruct {
    #[table(format(string = "%Y-%m-%d %H:%M:%S"))]
    my_field: NaiveDateTime
}
source§

impl CellValue for NaiveTime

Implementation for NaiveTime to work with the TableRow derive and the DefaultTableCellRenderer

#[derive(TableRow, Clone)]
#[table]
struct SomeStruct {
    #[table(format(string = "%H:%M:%S"))]
    my_field: NaiveTime
}
source§

impl CellValue for Fragment

§

type RenderOptions = ()

source§

fn render_value(self, _options: &Self::RenderOptions) -> impl IntoView

source§

impl CellValue for Decimal

Implementation for Decimal to work with the TableRow derive and the DefaultTableCellRenderer

#[derive(TableRow, Clone)]
#[table]
struct SomeStruct {
    #[table(format(precision = 2usize))]
    my_field: Decimal
}
source§

impl CellValue for Date

Implementation for Date to work with the TableRow derive and the DefaultTableCellRenderer

#[derive(TableRow, Clone)]
#[table]
struct SomeStruct {
    #[table(format(string = "[year]-[month]-[day]"))]
    my_field: Date
}
source§

impl CellValue for OffsetDateTime

Implementation for OffsetDateTime to work with the TableRow derive and the DefaultTableCellRenderer

#[derive(TableRow, Clone)]
#[table]
struct SomeStruct {
    #[table(format(string = "[year]-[month]-[day] [hour]:[minute]:[second] Z[offset_hour]"))]
    my_field: OffsetDateTime
}
source§

impl CellValue for PrimitiveDateTime

Implementation for PrimitiveDateTime to work with the TableRow derive and the DefaultTableCellRenderer

#[derive(TableRow, Clone)]
#[table]
struct SomeStruct {
    #[table(format(string = "[year]-[month]-[day] [hour]:[minute]:[second]"))]
    my_field: PrimitiveDateTime
}
source§

impl CellValue for Time

Implementation for Time to work with the TableRow derive and the DefaultTableCellRenderer

#[derive(TableRow, Clone)]
#[table]
struct SomeStruct {
    #[table(format(string = "[hour]:[minute]:[second]"))]
    my_field: Time
}
source§

impl CellValue for Uuid

Implementation for Uuid to work with the TableRow derive and the DefaultTableCellRenderer

#[derive(TableRow, Clone)]
#[table]
struct SomeStruct {
    my_field: Uuid
}
§

type RenderOptions = ()

source§

fn render_value(self, _options: &Self::RenderOptions) -> impl IntoView

source§

impl CellValue for NonZeroI8

§

type RenderOptions = ()

source§

fn render_value(self, _options: &Self::RenderOptions) -> impl IntoView

source§

impl CellValue for NonZeroI16

§

type RenderOptions = ()

source§

fn render_value(self, _options: &Self::RenderOptions) -> impl IntoView

source§

impl CellValue for NonZeroI32

§

type RenderOptions = ()

source§

fn render_value(self, _options: &Self::RenderOptions) -> impl IntoView

source§

impl CellValue for NonZeroI64

§

type RenderOptions = ()

source§

fn render_value(self, _options: &Self::RenderOptions) -> impl IntoView

source§

impl CellValue for NonZeroI128

§

type RenderOptions = ()

source§

fn render_value(self, _options: &Self::RenderOptions) -> impl IntoView

source§

impl CellValue for NonZeroIsize

§

type RenderOptions = ()

source§

fn render_value(self, _options: &Self::RenderOptions) -> impl IntoView

source§

impl CellValue for NonZeroU8

§

type RenderOptions = ()

source§

fn render_value(self, _options: &Self::RenderOptions) -> impl IntoView

source§

impl CellValue for NonZeroU16

§

type RenderOptions = ()

source§

fn render_value(self, _options: &Self::RenderOptions) -> impl IntoView

source§

impl CellValue for NonZeroU32

§

type RenderOptions = ()

source§

fn render_value(self, _options: &Self::RenderOptions) -> impl IntoView

source§

impl CellValue for NonZeroU64

§

type RenderOptions = ()

source§

fn render_value(self, _options: &Self::RenderOptions) -> impl IntoView

source§

impl CellValue for NonZeroU128

§

type RenderOptions = ()

source§

fn render_value(self, _options: &Self::RenderOptions) -> impl IntoView

source§

impl CellValue for NonZeroUsize

§

type RenderOptions = ()

source§

fn render_value(self, _options: &Self::RenderOptions) -> impl IntoView

Implementors§